Search This Blog


Showing posts with label pattern printing program. Show all posts
Showing posts with label pattern printing program. Show all posts

Wednesday, October 9, 2019

Pattern Printing program



Before starting the program ,make sure that you have completed your looping concept of programming . If you not completed yet then visit by clicking here LOOP PROGRAMMING CONCEPT.

 
c language by a step up
A step up programming
You can modify these programming by your own concept.

P1. Program to print the given pattern :-

 
 c language by A step up
P1. Pattern in c
#include<stdio.h>
#include<conio.h>
void main()
{
  int i , j ;
  for ( i = 1 ; i <= 5 ; i ++ )
  {
    for ( j = 1 ; j <= 5 ; j ++ )
   {
    if ( j <= i )
       printf ( “ * “ );
     else
        printf ( “  “ );
    }
  printf ( “ \n “ );
 }
getch ();
}

P2. Program to print the given pattern :-

 
c language by a step up
P2. Pattern in c
#include<stdio.h>
#include<conio.h>
void main()
{
  int i , j ;
  for ( i = 1 ; i <= 5 ; i ++ )
  {
    for ( j = 1 ; j <= 5 ; j ++ )
   {
    if ( j >= 6-i )
       printf ( “ * “ );
     else
        printf ( “  “ );
    }
  printf ( “ \n “ );
 }
getch ();
}

P3. Program to print the given pattern :-

 
c language by a step up
P3. Pattern in c
#include<stdio.h>
#include<conio.h>
void main()
{
  int i , j ;
  for ( i = 1 ; i <= 5 ; i ++ )
  {
    for ( j = 1 ; j <= 5 ; j ++ )
   {
    if ( j >= i )
       printf ( “ * “ );
     else
        printf ( “  “ );
    }
  printf ( “ \n “ );
 }
getch ();
}

P.4 Program to print the given pattern :-

 c language by a step up
P4. Pattern in c

#include<stdio.h>
#include<conio.h>
void main()
{
  int i , j ;
  for ( i = 1 ; i <= 5 ; i ++ )
  {
    for ( j = 1 ; j <= 5 ; j ++ )
   {
    if ( j <= 6-i )
       printf ( “ * “ );
     else
        printf ( “  “ );
    }
  printf ( “ \n “ );
 }
getch ();
}

P.5 Program to print the given pattern :-

 
c language by a step up
P5. Pattern in c
#include<stdio.h>
#include<conio.h>
void main()
{
  int i , j ;
  for ( i = 1 ; i <= 5 ; i ++ )
  {
    for ( j = 1 ; j <= 9 ; j ++ )
   {
    if ( j >= 6-i && j <= 4+i )
       printf ( “ * “ );
     else
        printf ( “  “ );
    }
  printf ( “ \n “ );
 }
getch ();
}

P.6 Program to print the given series :-

 
c language by a step up
P6. Pattern in c
#include<stdio.h>
#include<conio.h>
void main()
{
  int i , j , k ;
  for ( i = 1 ; i <= 5 ; i ++ )
  {
    k=1;
    for ( j = 1 ; j <= 9 ; j ++ )
   {
    if ( j >= 6-i && j <= 4+i && k )
      {
       printf ( “ * “ );
        k = 0;  
        }
     else
       {
        printf ( “  “ );
         k = 1 ;
          }
    }
  printf ( “ \n “ );
 }
getch ();
}

P.7 Program to print the given pattern :-

 
c language by a step up
P7. Pattern in c
#include<stdio.h>
#include<conio.h>
void main()
{
  int i , j ;
  for ( i = 1 ; i <= 5 ; i ++ )
  {
    for ( j = 1 ; j <= 9 ; j ++ )
   {
    if ( j <= 6-i || j >= 4 + i)
       printf ( “ * “ );
     else
        printf ( “  “ );
    }
  printf ( “ \n “ );
 }
getch ();
}

P.8 Program to print the given pattern :-

 
c language by a step up
P8. Pattern in c
#include<stdio.h>
#include<conio.h>
void main()
{
  int i , j , k ;
  for ( i = 1 ; i <= 4 ; i ++ )
  {
     k=1;
    for ( j = 1 ; j <= 7 ; j ++ )
   {
    if ( j >= 5-i && j <= 3+i )
      {
       printf ( “ %d “ , k );
        j<4?k++:k--;
       }
     else
        printf ( “  “ );
    }
  printf ( “ \n “ );
 }
getch ();
}

P.9 Program to print the given pattern :-

 
c language by a step up
P9. Pattern in c
#include<stdio.h>
#include<conio.h>
void main()
{
  int i , j ;
  char k ;
  for ( i = 1 ; i <= 4 ; i ++ )
  {
    k = ‘A’ ;
    for ( j = 1 ; j <= 7 ; j ++ )
   {
    if ( j <= 5-i || j >= 3+i )
     {
       printf ( “ %c “ , k );
        j <4 ? k++ : j-- ;
       }
     else
      {
        printf ( “  “ );
        if ( j == 4 )
            k--;
        }
    }
  printf ( “ \n “ );
 }
getch ();
}

P.10 Program to print the given pattern :-

 
c language by a step up
P10. Pattern in c
#include<stdio.h>
#include<conio.h>
void main()
{
  int i , j , k = 0;
  for ( i = 1 ; i <= 7 ; i ++ )
  {
    i <= 4 ? k++ : k-- ;
    for ( j = 1 ; j <= 7 ; j ++ )
   {
    if ( j >= 5-k && j <= 3+k )
       printf ( “ * “ );
     else
        printf ( “  “ );
    }
  printf ( “ \n “ );
 }
getch ();
}
If You want more pattern program like this then follow my blog and comment below .
share this blog to the needed person.

There are lots of more pattern like this which was updated later, so connect with us.
Basic concept of programming
More uderstanding program