Ask Question

Write a C+ + program that stores the integers 50 and 100 in variables and stores the sum of these two in a variable named total. Display the total on the screen.

+2
Answers (1)
  1. 8 August, 14:29
    0
    Following are the program in c++

    #include / / header file

    using namespace std; / / namespace

    int main () / / main function

    {

    int a=50, b=100, total; / / variable declaration

    total=a+b; / / sum of the two variable a and b

    cout<<"The total is:"<
    return 0;

    }

    Output:The total is:150

    Explanation:

    In this program we have declared two variable i. e "a" and "b" of int type which store the value 50 and 10 respectively. After that we adding these two variable and store the sum in total variable finally display the total
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a C+ + program that stores the integers 50 and 100 in variables and stores the sum of these two in a variable named total. Display ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers