Write a program using integers userNum and x as input, and output userNum divided by x four times. Ex: If the input is: 2000 2
1 answer:
Answer:
// here is code in c++.
// include header
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables to read input
int userNum,x;
cout<<"enter the value of userNum and x :";
// read the input from user
cin>>userNum>>x;
// divide the userNum with x 4 times
for(int a=0;a<4;a++)
{
userNum=userNum/x;
cout<<userNum<<" ";
}
cout<<endl;
return 0;
}
Explanation:
Declare two variables "userNum" and "x". Read the value of these. Run a for loop 4 time and divide the "userNum" with "x" and print the value of "userNum".
<u>Output: </u>
enter the value of userNum and x :2000 2
1000 500 250 125
You might be interested in
Answer:
i can't understand your language
Answer:
Thank you that's so very kind of you. Hope your having a good day.
Answer:
Wifi
Explanation:
because its wifi based
That would be the <span>Cumalitive Index to Nursing and Allied Health Literature.</span>
Answer:
pray for me i fell sick
Explanation:
i ate a piece of carrot now im blind