Sunday, January 1, 2012

Print following pattern. **** *** ** * in 'C'


****
***
**
*

Example



#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
printf("Enter the value of n:");
scanf("%d",&n);
for(i=0;i<=n;i++)
{
for(j=i;j<n;j++)
{
printf("*");
}
printf("\n\n");
}
getch();
}
/*=====================================================================
OUTPUT
Enter the value of n:4
****
***
**
*
*/


3 comments:

  1. ***
    **
    *
    please help me how to solve this problem

    ReplyDelete
  2. ***
    **
    *
    please help me how to solve this problem

    ReplyDelete
  3. ***
    **
    *
    please help me how to solve this problem

    ReplyDelete