Created
October 22, 2019 08:07
-
-
Save AdnanHussainTurki/9bbe23b413f3ec6695685aa462bfb6ce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @Author: Adnan | |
* @Date: 2019-09-16 07:55:34 | |
* @Last Modified by: Adnan | |
* @Last Modified time: 2019-10-22 13:37:02 | |
*/ | |
#include <iostream> | |
using namespace std; | |
/* | |
Method 1: Using while loop and incremental operator (++) | |
*/ | |
int main() { | |
cout << "PROGRAM: ADDITION OF TWO NUMBERS"; | |
cout << "\n"; | |
cout << "========================================================="; | |
int inputOne; //20 | |
cout << "\nEnter the first number:"; | |
cin >> inputOne; | |
int inputSecond; //10 | |
cout << "\nEnter the second number:"; | |
cin >> inputSecond; | |
int i =0; | |
while(i < inputSecond) { | |
inputOne++; | |
i++; | |
// cout << "\n\nThe value of Input One at " << i << " loop is " << inputOne; | |
} | |
cout << "\nThe sum of the number is "; | |
cout << inputOne; | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment