Tuesday 23 November 2010

display the following output

//display the following output:
55555
55556
55566
55666
56666
66666

#include<stdio.h>
#include<conio.h>
void main()
{
 int i,j,k;
 clrscr();
 for(i=0;i<=5;i++)
 {
  for(k=i;k<5;k++)
  {
   printf("5");
  }
  for(j=1;j<=i;j++)
  {
   printf("6");
  }
  printf("\n");
 }
 getch();
}


No comments:

Post a Comment