Program to input two numbers and print their sum in C.

In this program we input two number and print their sum. For this we have print a message for user by printf and input a number by using scanf. After this process we write program logic and print this as final output.

/*Program to add two number*/

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,s=0;
clrscr();
printf("Enter 1st number=");
scanf("%d",&a);
printf("Enter 2nd number=");
scanf("%d",&b);
s=a+b;
printf("Sum=%d",s);
getch();
}

OUTPUT









Related Examples 
1.Write a program to input two number and print their subtraction. 
2.Write a program to input two number and print their multiplication. 


Follow for recently updates.
Share and Comment. 

Comments

Popular posts from this blog

Write a program to input age of any person and check he is eligible for voting or not.

Write a program to input two digit number and check number is palindrome or not.

Write a program to input speed of Royal Enfield and check it's running at economic speed or not.