Program to print sum of 2 numbers | SpiderShell
Program :
#include<stdio.h>
int main()
{
int x=0; int y=0; int result=0;
printf("The first no is: ");
scanf("%d",&x);
printf("The second no is: ");
scanf("%d",&y);
if (result=x+y);
printf("The sum of two numbers : %d",result);
return 0;
}
Output :
The first no is: 45
The second no is: 45
The sum of two numbers : 90.

0 Comments:
Post a Comment