WELCOME

Welcome to KoDes4U

Pages

Friday, February 25, 2011

pattern printing( c-programs)





/*Write a C program to print the following pattern
                          *
                      * *
* * *
                     * * * *         coded by KoDes4u.Blogspot.com*/

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

No comments:

Post a Comment