1 22 333 4444 55555
#include <stdio.h>
int main()
{
int i, j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",i);
}
printf("\n");
}
return 0;
}
Related Links:
- More Number Pattern Programs
- Star Pattern Programs in C
- Alphabet Pattern Programs in C
- Series Programs in C
you have really helped us but please tell me what i and j stand for, please
ReplyDeletei for outer loop (rows)
Deleteand j for inner loop (columns)
There are just loop variables. It is not a syntax, just a terminology for loop. You can choose any name for these you want !!!
ReplyDeleteloop variables
DeleteThanks for the program, but will you please explain following for loop conditions? means what happen when inner & outer loop executes?
ReplyDeletefor(i=1;i<=5;i++)
for(j=1;j<=i;j++)
Thanks in advance
Incorrect
ReplyDeleteit's correct. Notice that printf has changed to print "i".
ReplyDeletethanxxxxxxxx
ReplyDeletePlease solve above number pattern by using while loop
ReplyDeleteint main(){
Deleteint i,j;
i=1;
while(i<=5){
j=1;
while(j<=i){
printf("%d",i);
j++;
}
i++;
}
return 0;
}
Want the mirror of this patter
ReplyDeleteWrite a C code to Print the following shapes:
ReplyDelete1) using scanf
Please tell me which one prints the num and which one prints the line inner loop or outer respectively.
ReplyDeletei need the algorithm of this code
ReplyDelete