Thursday, 31 July 2014

C program to add two numbers

Advertisement

C program to add two numbers: This c language program perform the basic arithmetic operation of addition on two numbers and then prints the sum on the screen. For example if the user entered two numbers as 5, 6 then 11 (5 + 6) will be printed on the screen.

C programming code

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


EmoticonEmoticon