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
stira [4]
3 years ago
5

In C language. Print numbers 0, 1, 2, ..., userNum as shown, with each number indented by that number of spaces. For each printe

d line, print the
leading spaces, then the number, and then a newline. Hint: Use i and j as loop variables (initialize i and j explicitly). Note: Avoid any
other spaces like spaces after the printed number. Ex: userNum = 3 prints:
Computers and Technology
1 answer:
Murrr4er [49]3 years ago
6 0

The program uses loops to print the numbers from 0 to the user input.

It also uses loops to print the indented space before each iteration value.

The program in C where comments are used to explain each line is as follows:

#include <stdio.h>

int main(){

<em>    //This declares userNum as integer</em>

   int userNum;

<em>    //This gets input for userNum from the user</em>

   scanf("%d",&userNum);

<em>    //This iterates through from 0 to userNum</em>

   for (int i = 0; i <= userNum; i++ ) {

<em>    //This iterates from 0 to current iteration value</em>

       for (int j = 0; j < i; j++ ) {

<em>    //This prints the indents</em>

           printf(" ");         }

<em>    //This prints the current iteration value</em>

       printf("%d\n",i);     }

}<em>//The program ends here</em>

<em />

At the end of the program, the program outputs the indent, followed by the iteration value and a new line.

See attachment for the program sample run

Read more about loops at:

brainly.com/question/21751160

You might be interested in
What are the limitations of the ASCII character set? State why it is limited in this way?
dedylja [7]
The problem with ASCII or extended ASCII is that the ASCII system can only represent up to 128 (or 256 for EASCII) different characters. The limitation on the number of character sets means representing character sets for several different language structures is not possible.
7 0
3 years ago
An electrician uses a device called a volt meter. The volt meter is an example of
kirill115 [55]

Answer:

hardware

Explanation:

A voltmeter can be defined as an electrical device used for measure voltage level or the amount of voltage present in a circuit.

In this scenario, an electrician uses a device called a volt meter. The volt meter is an example of hardware.

A hardware refers to any device, machine or equipment that can be handled physically (touched) and seen with the naked eyes. Other hardware components of a computer includes monitor, speaker, central processing unit, motherboard, hard-drive, joystick, mouse, keyboard, etc.

On the other hand, software component of a computer comprises of software application or program that are used by the computer to manage or control software application, computer hardware and user processes. Some examples of software components are operating system, registry keys, antivirus, media player, word processor, etc.

4 0
3 years ago
To make slides in a powerpoint online application presentation have the same transition effect, select __________ on the transit
Artemon [7]

Answer: Animations

Explanation:

Transitions, such as fade, can be applied to all using the command Ctrl+A.

Transitions are found under the animations Tab. Sorry about the bots.

Hope This Helped!

8 0
2 years ago
Make up a python program that can do the following
GalinKa [24]

Answer:

hrs=input("Enter Hour:")

rate=input("Eenter Rate per Hour:")

pay=float(hrs)*float(rate)

print("Pay:", pay)

Explanation:

7 0
3 years ago
How to save a file for the first time?​
White raven [17]

by typing ctrl+ s on keyboard

7 0
3 years ago
Read 2 more answers
Other questions:
  • While creating your résumé, what should you do before making a final copy to fix any typos or errors?
    6·1 answer
  • I'm stuck on this Java exercise problem and don't know how to organize my code with proper formatting and it's not helping that
    14·1 answer
  • Helping people keep track on things is the purpose of_____ A database B table C query D form​
    12·1 answer
  • Write a program named ArrayDemo that stores an array of 10 integers. (Note that the array is created for you and does not need t
    14·1 answer
  • The statistically multiplexed wan technology that is specifically designed to carry multiple kinds of traffic (data and voice is
    8·1 answer
  • Plz tell the answer I I'll mark u as the brainliest
    14·1 answer
  • Which popular file format loses some of the information from the image? JPEG TIFF RAW NEF
    12·1 answer
  • Type (dog, cat, budgie, lizard, horse, etc.) Create a class that keeps track of the attributes above for pet records at the anim
    7·1 answer
  • Name 2 ways that body temperature can be taken.​
    11·1 answer
  • A(n) __________ looks and acts just like a publicly accessible website and uses the same software, hardware, and networking tech
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!