asked 45.1k 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.

asked
User Xinux
by
8.8k 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.

answered
User Danielius
by
8.1k points

No related questions found