Write a c program to add two numbers.

In this example, the user is asked to enter two integers. Then, the sum of these two integers is calculated and displayed on the screen.

#include<stdio.h>
 
int main() {
   int a, b, sum;
 
   printf("\nEnter two no: ");
   scanf("%d %d", &amp;a, &amp;b);
 
   sum = a + b;
 
   printf("Sum : %d", sum);
 
   return(0);
}

Out Put

Enter two no: 5 6
Sum : 11

LEAVE A REPLY

Please enter your comment!
Please enter your name here