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
tresset_1 [31]
2 years ago
7

Write a program using integers userNum and divNum as input, and output userNum divided by divNum three times.

Computers and Technology
1 answer:
riadik2000 [5.3K]2 years ago
7 0

Answer:

Follows are the code to this question:

#include <iostream>//header file

using namespace std;

int main() //defining main method

{

int userNum, divNum;//defining integer variable

cin>> userNum >> divNum;//input values

cout <<"First-time divide: "<<userNum / divNum<<endl;//divide value First time  

cout <<"Second-time divide: " << userNum / divNum/divNum<<endl; //divide value Second time

cout<<"Third-time divide: "<< userNum /divNum/divNum/divNum<<endl;//divide value Third time

return 0;

}

Output:

2000

2

First-time divide: 1000

Second-time divide: 500

Third-time divide: 250

Explanation:

In this code two integer variable "userNum and divNum" is declared that uses the input method to input value from the user-end, and after input the value it divides the "userNum by divNum" three times, that is defined as follows:

In this code, the user input the value 2000 and 2, in the first divides it will give 1000, in the second time divide it will give 500, and in the third time it will give 250.

You might be interested in
Use the code below to answer the following questions. Note that the catch statements in the code are not implemented, but you wi
anzhelika [568]

Answer:

d) either e1 or e5

Explanation:

Here, the instruction i1 goes ahead in trying to open the given file through an input stream buffer reader. If the given file name is wrong, it will indicate that an e1 file is not found or if any other IO errors due to invalid stream, no disc in drive e5 IO exception will be drawn.

4 0
3 years ago
Create a Card class that represents a playing card. It should have an int instance variable named rank and a char variable named
Helen [10]

Answer:

Explanation:

The following code is written in Java. It creates the Card class and then uses it to create a full house and print out the rank and suit of every card in that hand.

class Card {

   int rank;

   char suit;

   public Card(int rank, char suit) {

       this.rank = rank;

       this.suit = suit;

   }

   public int getRank() {

       return rank;

   }

   public char getSuit() {

       return suit;

   }

}

class CardTester {

   public static void main(String[] args) {

       Card card1 = new Card(3, '♥');

       Card card2 = new Card(3, '♠');

       Card card3 = new Card(3, '♦');

       Card card4 = new Card(2, '♦');

       Card card5 = new Card(2, '♣');

       System.out.println("Card 1: " + card1.getRank() + " of " + card1.getSuit());

       System.out.println("Card 2: " + card2.getRank() + " of " + card2.getSuit());

       System.out.println("Card 3: " + card3.getRank() + " of " + card3.getSuit());

       System.out.println("Card 4: " + card4.getRank() + " of " + card4.getSuit());

       System.out.println("Card 5: " + card5.getRank() + " of " + card5.getSuit());

   }

}

3 0
3 years ago
Which of the following best describes the safety of blogging
Pavlova-9 [17]
We need the options
3 0
3 years ago
Which type of portfolio might a young investor who is not afraid of risk choose?
Keith_Richards [23]
i think it would be the investment with high risk and high return such as Stocks.When investing in stock, investor analyze whether a specific company will be doing well in the time of investment (which will increase the market price of the stock) and take a profit from it.
7 0
3 years ago
The fast movement of briefly flashed images in an animated motion picture produces what effect? subliminal messaging convergence
REY [17]

Answer:

The answer is Stroboscopic movement

Explanation:

Stroboscopic movement occurs when we do not see a motion continuously but in discrete shots. It is an effect in which we see an object at one place and after another instant the object seems to have shifted it's position.

Auto kinetic effect is an effect in which a stationary point of light appears to move.It occurs as our brains can perceive motion relative to some other object and cannot observe ,motion along a featureless terrain or environment.

Phi effect causes an observer to perceive motion in stationary objects.

3 0
2 years ago
Other questions:
  • I wonder how world is created
    12·2 answers
  • How do you do these two questions? The first might have multiple answers and the second will have only one answer.
    14·1 answer
  • 2.27 LAB: Driving costs Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as
    14·2 answers
  • 4. Which of the following root keys contains the data for a system’s non-user-specific configurations? a. HKEY_LOCAL_MACHINE b.
    14·1 answer
  • Should the existing system be replaced?This is a question that is asked during the _____ stage of the Systems Development Life C
    8·1 answer
  • How do i know when someone answered my questions and where can i check what they wrote?
    6·1 answer
  • PLEASEEEEEE HELP, ILL DO ANYTHING JUST ANSWER THESE CORRECTLY!!!!!TYSM!!!
    15·2 answers
  • I can't solve this <br> Python loop with while statement
    15·2 answers
  • Someone please make a random question with an easy answer because i need one more brainliest to UPGRADE!
    7·2 answers
  • When a ____________ file is opened, it appears full-screen, in slideshow mode, rather than in edit mode.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!