Advertisement
Felanpro

increment calculator

Nov 2nd, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdlib.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     /*Let user input number then amount of percentage
  9.     he/she want to increase the number with.*/
  10.  
  11.     double number;
  12.     double percentage_input;
  13.  
  14.     cout << "Input number: ";
  15.     cin >> number; cout << endl;
  16.  
  17.     cout << "Input percentage";
  18.     cin >> percentage_input; cout << "%" << endl;
  19.  
  20.     double percentage = percentage_input / 100;
  21.  
  22.     double increase_result = (number * percentage) + number;
  23.  
  24.     cout << "Increase of " << number << " with "
  25.     << percentage_input << " is equal to " <<
  26.     increase_result;
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement