codescracker


c

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 */
		
#include<stdio.h>
#include<conio.h>
void main()
{
	clrscr();
	int a, b, sum;
	printf("Enter two number :");
	scanf("%d%d",&a, &b);
	sum=a+b;
	printf("Sum of the two number is %d",sum);
	getch();
}

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 »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test