How to add 2 numbers in c programming ?
C PROGRAM TO ADD 2 NUMBERS
Program to add 2 numbers in c is given below....
_____________________________
#include<stdio.h>
int main()
{
int n1,n2,sum;
printf("Enter the value for n1:");
scanf("%d",&n1);
printf("Enter the value for n2:");
scanf("%d",&n2);
sum=n1+n2;
printf("Addition of the two numbers=%d",sum);
return 0;
}
_____________________________
Output:- Enter the value for n1:67
Enter the value for n2:92
Addition of the two numbers=159
This program will display in the laptop as shown below;
Thank you all -----
Follow my blog for more programming knowledge...
-------------x----------------------x-------------------------x---------------------------x--------------------x----------
Comments
Post a Comment