Question: C programming .. Print numbers 0, 1, 2, ..., userNum as shown, with each number indented by that number of spaces. For each printed line,
C programming ..
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 = 3 prints:
0 1 2 3

My problem is the whitespace after number 3. How can I fix it ?
this is the code I entered:
#include
int main(void) { int userNum = 0; int i = 0; int j = 0;
for (i=0;i
return 0; }
Thanks
Testing with userNum 3 Output is nearly correct, but whitespace differs. See highlights below 1 Your output 2 Expected output 2 3 X Test aborted Feedback
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
