C Program to Add Two Numbers | Entered by User



In this program, you will learn how to code C program to add two numbers. 

Here, user will be asked to enter two numbers, then the sum of two numbers will be displayed.

Program to add two numbers –

#include<stdio.h>

int main()
{
int x, y, z;

printf("Enter two numbers to add\n");

scanf("%d%d", &x, &y);

c = a + b;

printf("Sum of the numbers = %d\n", z);

return 0;

}

Output –

Enter two numbers to add
10
20

Sum of the numbers = 30


C Program Examples –



Post a Comment

0 Comments