Pages - Menu

Saturday, 19 July 2014

Addition of two numbers in C.

Here is the code



#include<stdio.h>
int main()
{
int a,b;
printf("Enter two numbers\n");
scanf("%d%d",&a,&b);
printf("The sum is of %d and %d is %d",a,b,(a+b));
return 1;
}

For Turbo C Users.




#include<stdio.h>
#include<conio.h>
int main()
{
int a,b;
printf("Enter two numbers\n");
scanf("%d%d",&a,&b);
printf("The sum is of %d and %d is %d",a,b,(a+b));
getch();
return 1;
}


No comments:

Post a Comment