Dremendo Tag Line
t

Print sum and product of 2 numbers in C++

cout - Question 9

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

Q9) Write a program in C++ to find the sum and product of 2 integer numbers like int a=5 and b=3.

Program

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

using namespace std;

int main()
{
    int a=5,b=3;
    cout<<"Sum="<<a+b<<endl;
    cout<<"Product="<<a*b;
    return 0;
}

Output

Sum=8
Product=15
video-poster