Dremendo Tag Line
t

Print sum of 2 integer numbers in C++

cout - Question 6

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

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

Program

#include <iostream>
#include <conio.h>

using namespace std;

int main()
{
    int a=7,b=13;
    cout<<"Sum="<<a+b;
    return 0;
}

Output

Sum=20
video-poster