45.0k views
5 votes
Write a recipe that stores the sum of the numbers 12 and 33 in a variable named sum. Have your recipe display the value stored in sum.

User Xinux
by
6.4k points

1 Answer

1 vote

Answer:

#include<iostream>

using namespace std;

int main(){

int sum = 12+33;

cout<<"The sum is: "<<sum<<endl;

}

Step-by-step explanation:

First include the library iostream in c++ program for input/output.

Then, create the main function and declare the variable sum as integer type and store the sum of two given values.

After that, display the result store in the sum variable on the screen by using the instruction cout.

User Danielius
by
5.2k points