Write a program add two number in c.
//Add two number.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,sum;
printf("\n Enter First Number=");
scanf("%d",&a);
printf("\n Enter Second Number=");
scanf("%d",&b);
sum=a+b;
printf("\n Sum=%d",sum);
//Second method
printf("\n Sum=%d+%d=%d",a,b,a+b);
getch();
}
Output:- Enter First Number=5
Enter Second Number=2
Sum=7
Sum=5+2=7
Related C Programs..
- Write a program to add two numbers. (Solution).
- Write a program to subtraction two number. (Solution).
- Write a program to Multiplication Two Number. (Solution).
- Write a program to Calculate Simple interest. (Solution).
- Write a program to Division two numbers. (Solution).
- Write a program to calculate area of a circle. (Solution).
- Basic Question All
0 Comments