Add Two Numbers in C

To add two numeric values in C #include<stdio.h> int main(){ float a, b; printf("Enter two numbers\n"); scanf("%f %f",&a,&b); printf("sum of %f and %f is %f",a,b,a+b); return 0; } Output: Enter two numbers 12 34 sum of 12.000000 and 34.000000 is 46.000000

December 28, 2014 · 1 min · Zeeshan Khan