Tuesday, 25 February 2014

Tagged Under:

Program to add two numbers

Share





In this program, user is asked to enter two integers and this program will add these two integers and display it.

Source Code

#include<stdio.h>
int main()
{
int a,b,c;
printf("Enter first value="); // 1st number
scanf("%d", &a);
printf("Enter second value=n"); // 2nd number
scanf("%d", &b);
c=a+b; // Add
printf("sum=%d", c); // result store in c variable
return 0;
}

Output


0 comments:

Post a Comment

Contact Us

Want to ask anything? Be our guest, give us a message.

Name Email * Message *