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
You want to install an rodc in your windows server 2003 forest, which currently has all windows server 2003 domain controllers.
devlian [24]
Make sure the functional level of the forest functional level is Windows Server 2003 or higher. 
Install at least one Windows 2008 Server as a Writable Domain Controller
Run adprep /rodcprep<span> </span>
8 0
2 years ago
The area that holds all the startup instructions the computer needs to start is the
Zigmanuir [339]
The area that holds all the startup instructions the computer needs to start is the ROM, or read-only memory. 
8 0
3 years ago
Ian’s photography teacher asks him to take some photos of a few different species over the weekend. Which group of photos would
alina1380 [7]
I think it’s b or d..............
5 0
3 years ago
Why are streak plates used to test minerals?
Sphinxa [80]

A. Small impurities can cause big changes in the color of a mineral.

5 0
3 years ago
What does AU stand for in computer?
SpyIntel [72]

Answer:

AU stands for <em>Audio Units.</em>

7 0
2 years ago
Other questions:
  • You should use _____ software for writing a letter.
    10·1 answer
  • You use a(n) ____ variation when a use case is less specific than others, and you want to be able to substitute the more specifi
    8·1 answer
  • Which of the following is the final fate for average sized stars?
    12·1 answer
  • Jared does not update his computer’s system software. What threat does his computer face?
    9·1 answer
  • Which of the following would a high school graduate interested in the performing arts most likely do after graduation?
    10·1 answer
  • The desktops of computers running the same OS all look the same
    8·1 answer
  • PLZ HELP ME! What is a false statement about online time?
    9·1 answer
  • Harry Potter and his friends are at Ollivander's with Ron, finally replacing Charlie's old broken wand. Hermione decides the bes
    11·1 answer
  • Which of these is one of the primary concerns for protecting your family when online?
    9·2 answers
  • Any anime weebs wanna talk
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!