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
gtnhenbr [62]
3 years ago
13

How would you print from 1 to 1000

Computers and Technology
1 answer:
Hitman42 [59]3 years ago
5 0

Answer:

There are two ways to print 1 to 1000

  1. Using Loops.
  2. Using Recursion.

Explanation:

Using loops

for(int i=1;i<=1000;i++)

{

  cout<<i<<" ";

}

Using recursion

Remember you can implement recursion using a function only.

void print(int n)

{

  if(n==0)

  return;

  print(n-1);

  cout<<n<<" "';

}

you should pass 1000 as an argument to the function print.

You might be interested in
Create a program to calculate the wage. Assume people are paid double time for hours over 60 a week. Therefore they get paid for
Rus_ich [418]

Answer:

Written in Python

name = input("Name: ")

wageHours = int(input("Hours: "))

regPay = float(input("Wages: "))

if wageHours >= 60:

->total = (wageHours - 60) * 2 * regPay + 20 * 1.5 * regPay + regPay * 40

else:

->total = wageHours * regPay

print(name)

print(wageHours)

print(regPay)

print(total)

Explanation:

The program is self-explanatory.

However,

On line 4, the program checks if wageHours is greater than 60.

If yes, the corresponding wage is calculated.

On line 6, if workHours is not up to 60, the total wages is calculated by multiplying workHours by regPay, since there's no provision for how to calculate total wages for hours less than 60

The required details is printed afterwards

Note that -> represents indentation

4 0
3 years ago
What policy definition can help remind employees in the User Domain about what constitutes suitable use and improper use of corp
Helga [31]

Answer:

so so sorry I don't know

Explanation:

hope fully you'll get the answer

4 0
3 years ago
Dates of birth were entered into a computer program . The data was stored in the format DAY/MONTH/YEAR.The program rejected this
Marina CMI [18]

Answer:

i. This value was not accepted because we have 12 months and not 13.

ii. This is because the user entered the value for the day as value for the month.

Explanation:

i. Why was this not accepted?

This value was not accepted because we have 12 months and not 13. The user entered a value that was above the maximum value registered for the number of months in a year- which is 12.

ii. Why do you think this error occurred

This is because the user entered the value for the day as value for the month.

This could be because the user uses a date system different from that of the program.

3 0
2 years ago
Match the following:
Bogdan [553]

Answer:

  1. Operating System.
  2. Laptop.
  3. Convertible computer.
  4. Peripheral.
  5. Desktop Computer.

Explanation:

Operating system is a software that manages the hardware and the software in the system and provides the interface between machine and the user.

Laptops are the portable computing devices which you can carry with you.

Convertible computer have a keyboard that is detachable and can be converted into a tablet.

Peripherals are devices which we can attach to the computer.

Desktop computer is a computing device that not portable at all.

3 0
3 years ago
How does math help you determine the amount of watts a turbine produces?
vlada-n [284]
It helps you determine the amount of watts a turbine produces because math is the only way to go
7 0
3 years ago
Other questions:
  • Print "Censored' if userlnput contains the word "darn, else print userlnput. End with newline. Ex: If userinput is "That darn ca
    11·1 answer
  • Assume you have just started a new job, have a car loan, and have a student loan. You have just received a cash gift of $1,000 f
    14·1 answer
  • To easily add an organizational chart to a document, users should select _____. SmartArt Text Boxes Shapes Clip Art
    8·2 answers
  • HELP ME PLZ QUICK Adam is writing a program that: 1) has the user guess a number, and 2) tells the user how many guesses it took
    11·1 answer
  • Is anyone really good at immerse 2 learn??
    9·1 answer
  • Post as a reply your example of "data, which is processed into information" case - examples should not necessarily be related to
    13·1 answer
  • CLICK ME IF U DARE hehehe
    10·2 answers
  • If you could design your own home, what kinds of labor-saving computer network or data communications devices would you incorpor
    9·1 answer
  • Can somebody tell me the Minecraft command to clear an entire world and destroy every block if u Dunno please don’t answer &gt;-
    13·1 answer
  • Which statement correctly differentiates how to use list and table styles?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!