1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alex787 [66]
3 years ago
15

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

Computers and Technology
1 answer:
STatiana [176]3 years ago
3 0

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
Which are among the ways you can use bitlocker encryption? (choose all that apply?
igor_vitrenko [27]
There is a lot of ways that you can use the bit locker encryption. Some are when you are authenticating your computer using a TPM. Or when you are authenticating your account using a USB Flash drive, and most on the phones authentication through text messages and all.
3 0
3 years ago
After reading passage “the incredible machine” why do you think the article has been titled so?
Vitek1552 [10]
I haven’t read it, but just by the title it was probably talking about an incredible machine that was new to people.
7 0
3 years ago
Why is peer answer always not working? just wondering idk why
Nady [450]
Wait.....What do you mean?
5 0
3 years ago
Read 2 more answers
In one sentences describe how to change your home page
3241004551 [841]

Click Tools, Internet options. ...The Internet Options window will open. ...Click Apply, OK to close the window.Click the wrench icon in the top-right corner of the browser.Select Options.In the 'On startup' section, select Open the home page.options window will open. Go to the Startup section and select When Firefox starts: Show my home page.. In the Home Page field, type in the website address you want to use as your home page.Click OK.


4 0
3 years ago
For electronically deposited funds, such as an employee's direct deposit, when must banks make those funds available to the empl
Kazeer [188]
I'm in computers class and I would say
6 0
3 years ago
Other questions:
  • You would like to arrange the records alphabetically. You should _____.
    7·2 answers
  • Which organizational pattern would probably be most effective for arranging the main points of a speech with the specific purpos
    15·1 answer
  • What may happen if there is too much harmony in a design?
    14·1 answer
  • Which command can be used to find errors on a hard drive​
    6·1 answer
  • Meaning of ‘integrity of data’
    14·2 answers
  • Anyone wanna join zoo m???????​
    10·2 answers
  • Accenture has put together a coalition of several ecosystem partners to implement the principles of blockchain and Multi-party S
    5·1 answer
  • Write a SELECT statement that returns one row for each musician that has orders with these columns:
    13·1 answer
  • Which of these words is used to begin a conditional statement?<br> when<br> input<br> if<br> until
    8·1 answer
  • What is the primary way that social networks work? Multiple Choice providing a security system for communication online connecti
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!