Pages

Monday, 8 June 2015

C program to add two Float numbers

C program to add two Float numbers

Coding:

#include<stdio.h>
int main()
{
float a, b, c;
printf("Enter two numbers to add\n");
scanf("%f%f",&a,&b);
c = a + b;
printf("Sum of entered numbers = %f\n",c);
return 0;
}

Output:
Enter two numbers to add
10.2 20.8
Sum of entered numbers = 31.000000