C program to print the sum of two numbers.
Q3. Write a C program to print the sum of two numbers.
Solution:
#include<stdio.h> //standard input/output header file
#include<conio.h> //for clrscr()
int main()
{
int a,b,sum;
clrscr(); //to clear the screen
a=5;
b=7;
sum=a+b;
printf(“\n Sum=%d”,sum);
getch(); //hold the screen until a key is pressed
return 0; //makes the main() to finish
}
OUTPUT:
Sum=12