Program to display the following structure:
1 2 3 4 5 6 7 8 9
2 3 4 5 6 7 8 9
3 4 5 6 7 8 9
4 5 6 7 8 9
5 6 7 8 9
6 7 8 9
7 8 9
8 9
9
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<10;i++)
{
printf("%d",i);
for(j=i+1;j<10;j++)
{
printf("%d",j);
}
printf("\n");
}
getch();
}
No comments:
Post a Comment