How would you write a program that allows a user to continue to use the program as long as the person doesn't enter, for example, 'f' to finish?
here's my attempt:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
usingnamespace std;
int main()
{
int number;
cout << "Enter number or press 'f' to finish: ";
cin >> number;
while(number != 'f')
{
cout << "Number entered is " << number;
cout << "Enter number or press 'f' to finish: ";
cin >> number;
}
return 0;
}
I don't think this is right, help is greatly appreciated!