print numbers 0, 1, 2, ..., usernum as shown, with each number indented by that number of spaces. for each printed 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

Respuesta :

To print the integers from 0 to the user input, the program use loops. Additionally, the indented space before each iteration value is printed using loops.

This is the C program that uses comments to explain each line:

#include <stdio.h>

int main(){

  //This declares userNum as integer

  int userNum;

  //This gets input for userNum from the user

  scanf("%d",&userNum);

  //This iterates through from 0 to userNum

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

  //This iterates from 0 to current iteration value

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

  //This prints the indents

          printf(" ");         }

  //This prints the current iteration value

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

}//The program ends here

Learn more about program here-

https://brainly.com/question/14618533

#SPJ4