-->

Facebook

Jasper Roberts - Blog

Tuesday, October 14, 2014

Write a c program to draw the following pattern-5.


/*
     12345
      2345
       345
        45
         5
*/


#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();

for(i=1;i<=5;i++)
{

for(j=1;j<=5;j++)
{
if(j<i)
printf(" ");
else
printf("%d",j);
}
printf("\n");
}
getch();
}
               
OUTPUT:
     12345
      2345
       345
        45
         5


2 comments: