Thursday 23 July 2015

C Program - To find the sum of two variables

C Program to find the sum of two variables 




#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,sum;
clrscr();
printf("\nEnter the value for a :- ");
scanf("%d",&a);
printf("\nEnter the value for b :- ");
scanf("%d",&b);
sum=a+b;
printf("\nThe sum of a and b :- %d",sum);
getch();
}

Output :- 


Enter the value for a :- 10
Enter the value for b :- 20
The sum of a and b :- 30

Back to 'C Language Programs'

No comments:

Post a Comment