- we have to declare to three variables in the program.
- we initiate the values of any two variable.
- now store the sum of these two variables in into the third variable.
the example of this program in c can be seen as:
#include<stdio.h>
#include<conio.h>
void main()
{
int a=5,b=6,sum;
sum=a+b;
printf("sum of two numbers is %d",sum);
getch();
}
output of this c program will be : 11
No comments:
Post a Comment