Help for C programing

Closed
AT - 13 Mar 2010 à 10:16
 pranav - 20 Mar 2010 à 13:35
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 responses

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();
}
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();
}