OUTPUT:
TIMER:
UNDERSTAND THIS CODE 60 seconds.
CONCEPT:
first, take i and j loop respective to rows and columns and then define them where you want to number in the first loop(means i) and then to make a right-angle triangle here is the code:
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
statement;
}
}
and then print that variable.
C CODE(RUNS ON TURBO C++):
#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 Comments
if you have any doubt, plz let me know