what is the function of k=k-1 and this is the question . Generate the following “pyramid” of digits, using nested loo

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 14RQ
icon
Related questions
Question

what is the function of k=k-1

and this is the question . Generate the following “pyramid” of digits, using nested loops,

#include <stdio.h>
int main ()
int i,j, k=6,m;
for (i=1; i<=6; i++)
{
for (j=1; j<=k; j++)
{
printf (" ");
}
1 for (m=1; m<=i; m++) {
printf("%d",i);
printf (" ");
}
printf("\n");
k=k-1;
}
}
Transcribed Image Text:#include <stdio.h> int main () int i,j, k=6,m; for (i=1; i<=6; i++) { for (j=1; j<=k; j++) { printf (" "); } 1 for (m=1; m<=i; m++) { printf("%d",i); printf (" "); } printf("\n"); k=k-1; } }
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Matrix multiplication
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT