Simple program to add two numbers
#include <stdio.h>
int main (void)
{
int v1, v2, sum; //v1,v2,sum are variables and int is data type declared
v1 = 150;
v2 = 25;
sum = v1 + v2;
printf ("The sum of %i and %i is= %i\n", v1, v2, sum);
return 0;
}
Output:
The sum of 150 and 25 is=175
#include <stdio.h>
int main (void)
{
int v1, v2, sum; //v1,v2,sum are variables and int is data type declared
v1 = 150;
v2 = 25;
sum = v1 + v2;
printf ("The sum of %i and %i is= %i\n", v1, v2, sum);
return 0;
}
Output:
The sum of 150 and 25 is=175
0 comments:
Post a Comment