110k views
2 votes
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, the output is: 1000 500 250 125 Note: In Coral, integer division discards fractions. Ex: 6 / 4 is 1 (the 0.5 is discarded).this must be written in Coral Language

User Pa
by
5.6k points

1 Answer

3 votes

Answer:

integer userNum

integer x

integer i

put "Enter the user number: "

userNum = Get next input

put "Enter the x value: "

x = Get next input

for i = 0; i < 4; i = i + 1

put userNum/x to output

Step-by-step explanation:

Coral Programming language is an ultra-simple programming language for learning programming. The first three rows of the code block declare the variables 'userNum', 'x', and 'i'. The "Get next input" and the "Put 'output_value' to output" are used by the program to get input from the user and output a value to the screen respectively.

User Ayodele
by
5.3k points