in C++
Write a program to use the IF ELSE statement in the following way.
Have the user input a value, x
If the value is less than 100, present, "you got 5% interest" and display on the screen the total of the X*1.05
Else print on the screen, "you got 10% interest", and display the value
X*1.10.
#include<iostream> using namespace std; int main() { int x; cout<<"Enter input: "; cin>>x; if(x<100){ cout<<"you got 5% interest"<<endl; cout<<(x*1.05)<<endl; } else{ cout<<"you got 10% interest"<<endl; cout<<(x*1.10)<<endl; } return 0; }
Get Answers For Free
Most questions answered within 1 hours.