C Program to Add Two Numbers

« Previous Program Next Program »

Add Two Numbers in C

To add two numbers in C programming, ask to the user to enter the two number and place the addition of the two number in third variable of the same type and print the third variable

C Programming Code to Add Two Numbers

Following C program ask to the user to enter the two number to add and display the addition result on the screen:

/* C Program - Add Two Numbers */
void main()
	int a, b, sum;
	printf("Enter two number :");
	scanf("%d%d",&a, &b);
	printf("Sum of the two number is %d",sum);

When the above c program is compile and executed, it will produce the following result:

c program to add two numbers

Same Program in Other Programming Language

You may also like same program in other programming languages:

« Previous Program Next Program »


Quick Links
Signup - Login - Give Online Test