+ 1
Pls help to finish this C code
Write a program in C to display the following pattern 100 90 80 70 60 50 40 30 20 10 #include<stdio.h> #include<stdlib.h> int main() { int n=4; int k=100; for(int i=1;i<=n;i++)//for outer loop { for(int j=n;j>=i;j--)//for inner loop { printf("%d\t",k--); } printf("\n"); } }
6 Answers
+ 2
Show your attempt please
+ 2
Just instead of printing k--, print k, and after printf, make k-=10 to decrement it by 10 and you're done
k-=10 is the same as k=k-10
+ 1
I have attached my attempt above...can u help me
+ 1
Thanks a lot! I really appreciate it
+ 1
Thanks a lot for ur explanation martin!
0
Im sorry,im a noob,how can i decrement k by 10?