Pages

Tuesday, October 18, 2011

write a program that will display the following pattern, given the value n

#include<stdio.h>
#include<conio.h>
#define p printf
#define s scanf

main()
{
      int a,b,num;
      p("Enter a number:");
      s("%d",&num);
   
      for(a=1; a < num+1; a++)
      {
               for (b=0; b < a; b++)
              p("*");
               p("\n",a);
               }
               getch();
               return 0;
    

No comments:

Post a Comment