C Program to add two numbers


In this program, You will learn how to add two numbers in C.


30 = 20 + 10

40 = 20 + 20


Example: How to add two numbers in C

Run it Now
#include<stdio.h>

int main() {

   int x, y, z;

   printf("Enter Two Numbers :");
   scanf("%d%d", &x, &y);

   z = x + y;
   printf("\nThe Sum is :%d", z);

   return 0;
}

Output:

Enter Two Numbers :12 13
The Sum is :25