Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

c program to print pyramid pattern of numbers

 #1: C Program to Print Pyramid pattern of n stars

  1. #include
  2. //c program to print pyramid pattern of numbers
  3. // www.instanceofjava.com
  4. int main(){
  5.    int number,k,m;

  6.     printf("Number of lines of star pattern  ");
  7.     scanf("%d", &number);

  8.     printf("\n");

  9.     for(  k = 1; k
  10.     {
  11.         for( m = 1; m
  12.         {
  13.             printf("*");
  14.         }
  15.         printf("\n");
  16.     }

  17.    getch();
  18. }

Output:



#2: C program to Print pyramid pattern of n Numbers

  1. #include
  2. //c program to print pyramid pattern of numbers
  3. // www.instanceofjava.com
  4. //pyramid pattern in c
  5. //write a c
  6.  program to print following pattern
  7. int main(){
  8.    int number,k,m;

  9.     printf("Number of lines of star pattern  ");
  10.     scanf("%d", &number);

  11.     printf("\n");

  12.     for(  k = 1; k
  13.     {
  14.         for( m = 1; m
  15.         {
  16.            printf("%-5d ", m);
  17.         }
  18.         printf("\n");
  19.     }

  20.    getch();
  21. }

Output:





This post first appeared on Java Tutorial - InstanceOfJava, please read the originial post: here

Share the post

c program to print pyramid pattern of numbers

×

Subscribe to Java Tutorial - Instanceofjava

Get updates delivered right to your inbox!

Thank you for your subscription

×