Help for C programing

Closed
AT - Mar 13, 2010 at 10:16 AM
 pranav - Mar 20, 2010 at 01:35 PM
Hello,

I need help to understand the following program:

A program to print a square of size 5 by using the character S &
A program to print the following outputs using loops:

(i) 1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

Plz! Anyone try 2 help me.

2 replies

hi! iam pranav iam sending you a program:
#include<stdio.h>
void main()
{
int i,j;
clrscr();
for(i=i;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
getch();
}
0
hi iam pranav my first answer was wrong here is the right one
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",i);
}
printf("\n");
}
getch();
}
0