Its an exam question that wants to modify code so that the following output is generated
1 2 3 4 5
2 3 4 5
3 4 5
4 5
5
This was the original code
#include<stdio.h>
void main()
{
int i,j;
for(i=1;i<5;i++)
{
for(j=1;j<=5;j++)
{
printf("%d",i);
}
printf("\n");
}
}
and this is wat i have tried so far:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
printf("%d",i++);
}
printf("\n");
}
getch();
}
of course this jus prints one line: 12345
idk y im not able to figure this out plz help?