Sum of Two Numbers in C | Sum of Two Variables in C

Program: Sum of Two Numbers in C
Sum of two variables in C programs:
 int main()
  int var1;
  int var2;
  int var3;
  printf("Type the first value 
var1 = ");
  printf("Type the second value 
var2 = ");
  var3 =var2+var1;
   printf("var3 =  %d",var3);
  return 0;
Type the first value var1 = 7
Type the second value var2 = 3
var3 = 10

  •  First three integers variables var1, var2, var3 are declared.
  • The values of var1, var2 are entered from keyword by the user.
  • The addition of two variables values var1, var2 are stored in var3.
    Sum of Two variables in C
  • In the last printf prints the value of var3.
See also:

Our Services

Search This Blog

  • ()
Powered by Blogger.

C Data Types and Types of data types in C

Data types specify the type of data that a variable can store. All C compilers support Five fundamental data types, they are an integer(int...

Blog Archive