Important C Programs

C Program to Add Two Integers

//C Program to Add Two Integers
//Header Files

//main function
//where the execution of program begins
void main()

int a,b,sum;
printf("Enter two integers: ");

// Two integers entered by user is stored using scanf() function
scanf("%d %d", &a, &b);

// sum of two numbers in stored in variable sum
sum = a + b;

// Displays sum
printf("%d + %d = %d", a, b, sum);



You can also see a video how to run this program