Write a program using integers usernum and x as input, and output usernum divided by x four times.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
#include <iostream> using namespace std; int main() { long YourNumber; long number=0; cout << "PleaseInput the YourNumber :>"; cin >> YourNumber; while (number==0) { cout << "Please Input number :>"; cin >> number; } for (int iLoop=0; iLoop<4; iLoop++) { YourNumber /= number; cout << YourNumber << " "; } } |
Output
PleaseInput the YourNumber : 100
Please Input number : 19
10Â Â Â 1Â Â Â 0Â Â Â 0