Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AdnanHussainTurki/9bbe23b413f3ec6695685aa462bfb6ce to your computer and use it in GitHub Desktop.
Save AdnanHussainTurki/9bbe23b413f3ec6695685aa462bfb6ce to your computer and use it in GitHub Desktop.
/*
* @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