 ## Sum of two numbers in C Language enter by user

### Write a program in C Language to Sum of two numbers enter by users

In this program, user is asked two numbers. Then, the sum of those two numbers is initialize in a variable and displayed on the screen.

# Program to Sum of two numbers enter by user

``````/*    Sum of two Numbers enter by User    */
#include<stdio.h>
int main()
{
int a;
int b;
int c;

printf("Enter your first value \n");
scanf("%d",&a);
printf("Enter your second value \n");
scanf("%d",&b);
c = a + b;
printf("a = %d and b = %d \nSum of a and b = %d",a, b, c);
return 0;
}``````

### Output:

a = 10 and b = 20
Sum of a and b = 30

In this program, user is asked to enter two numbers. Two integers entered by the user is initialize in variables a and b respectively. This is done using scanf() function.

Then, variables a and b are added using + operator and the result is initialize in c.

Sum of two numbers in C programming

Finally, the c is displayed on the screen using printf() function.

### This Post Has One Comment

1. Thanks for this code