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.
learn switch case statement
You can modify these programming by your own concept.
P1. Program to print the given pattern :-
#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 :-
#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 :-
#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 :-
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 :-
#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 :-
#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 :-
#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 :-
#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 :-
#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 :-
#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
This was helpful nice keep it up.......!
ReplyDeleteThanxx. And share to the needed one.
DeleteNice bro
ReplyDeleteThanxx bro.
Delete