0

How can i write following triangle pattern in C language? #newbie

Input: 10 Output: 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5

22nd May 2020, 7:42 AM
Asad al aziz(ì•„ì‚Źë“œ)
Asad al aziz(ì•„ì‚Źë“œ) - avatar
5 RĂ©ponses
22nd May 2020, 1:17 PM
Asad al aziz(ì•„ì‚Źë“œ)
Asad al aziz(ì•„ì‚Źë“œ) - avatar
0
𝐊𝐱𝐱𝐛𝐹 𝐆𝐡𝐚đČđšđ„ it is my first question, that's why i don’t know about it! Please check it, It's okay?
22nd May 2020, 1:27 PM
Asad al aziz(ì•„ì‚Źë“œ)
Asad al aziz(ì•„ì‚Źë“œ) - avatar
0
I already wrote the code! #include<stdio.h> int main() { int n,j,k,i,c=1; scanf("%d",&n); for(i=1;i<=n;i++) { for(k=1;k<=n-i;k++) { printf (" "); } for(j=1;j<=i;++j) { if(c==10) { c=0; } printf ("%d ",c); ++c; //printf ("* "); } printf ("\n"); } return 0; }
22nd May 2020, 1:33 PM
Asad al aziz(ì•„ì‚Źë“œ)
Asad al aziz(ì•„ì‚Źë“œ) - avatar