Powered by Blogger.

C program to add 2 integers and print the result

#include<stdio.h>
 
int main()
{
   int a, b, c;
 
   printf("Enter two numbers to add :\n");
   scanf("%d%d",&a,&b);
 
   c = a + b;
 
   printf("Sum of entered numbers = %d\n",c);
 
   return 0;
}

/*
Output :
Enter two numbers to add : 
5
3
Sum of entered numbers = 8
*/