Dremendo Tag Line

Print sum of 2 integer numbers in C

printf() - Question 6

In this question, we will see how to print the sum of 2 integer numbers in C programming using the printf() function. To know more about printf() function click on the printf() function lesson.

Q6) Write a program in C to print the sum of 2 integer numbers like int a=7, b=13.

Program

#include <stdio.h>
#include <conio.h>

int main()
{
    int a=7,b=13;
    printf("Sum=%d",a+b);
    return 0;
}

Output

Sum=20
video-poster