counter

Free Hit Counter

C program to print a pattern

Q: Print 1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5


#include
#include
void main()
{
int i,j,n;
printf("enter value of n:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
printf("%d",j);
}
printf("\n");
}
getch();
}

No comments:

Post a Comment