Wednesday 20 August 2014

Program to make number pattern


Q: Write a program in C to make a number pattern like                        
                                                                                                                           submit to reddit
1
22
333
4444
55555

Ans:-
#include<conio.h>
#include<stdio.h>
void main()
{
int i,j,num;
clrscr();
printf("\nEnter The limit\n");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
  for(j=1;j<=i;j++)
   {
     printf("%d",i);
   }
printf("\n");
}
getch();
}

No comments:

Post a Comment

Tell Us What You've Got...