Chapter 2 – #1: Sum of Two Numbers – Tony Gaddis – Starting Out With C++
Problem
Write a program that stores the integers 62 and 99 in variables, and stores the sum of
these two in a variable named total.
Solution:-
#include <iostream> //Header File For cout Function
using namespace std;
int main() //Function Name
{
int a, b; //Varriable Declare
a = 62;
b = 99;
int total = 0; //Declare Variable For Total
total = a + b; //Calculation
cout << total; //Display Output
return 0; // Return Value To The Main Function
}
This is the Solution of this problem.
Also, you can check it on your compiler.
I attach Link of CPP File You can Download and Check it.
1 Comments
Thanks Bro
ReplyDelete