Pages

Labels

C Program to sum 2 numbers...

Get sum of two number


#include <stdio.h>
#include <math.h>
main ()
{
  int a, b, c;
  printf ("Enter the value of a & b:");
  scanf ("%d%d", &a, &b);
  c = a + b;
  printf ("sum of the two numbers is:%d\n", c);


  getch ();
}



Output:-
Enter the value of a & b: 2 , 3
Sum of the two numbers is: 5

How it works
After getting two numbers, it does sum and prints the total.

Followers