+ 1

pattern of numbers

Write a program to print the following output using (for loop) in c. 1 23 456 78910

20th Apr 2018, 6:50 PM
Jordan
Jordan  - avatar
3 odpowiedzi
+ 1
Post your work so we can help you
20th Apr 2018, 7:59 PM
KrOW
KrOW - avatar
+ 1
#include <stdio.h> #include<conio.h> void main() { int r, sp, p, no=4,n; /*to print the pyramid in center, you can also increase the # of spaces*/ n=no; for (r=1;r<=4;r++) { for (sp=1;sp<=4;sp++) { printf(" "); }n--; for (p=1;p<=r;p++) { printf("%d ",r); } printf("\n"); } getch(); }
21st Apr 2018, 7:12 AM
Jordan
Jordan  - avatar
0
For next times save your codes on appropriate section (they will run also) and post link in discussion... Anyway this is my edited code: https://code.sololearn.com/c066ZWNeTIS5/?ref=app If you dont understand something tell
21st Apr 2018, 8:39 AM
KrOW
KrOW - avatar