C Programming
C Programming

Wing Pattern Programming, Butterfly pattern Programming, pattern program in java, pattern program in C, pattern programming questions

Wing Pattern Programming, Butterfly pattern Programming, pattern program in java, pattern program in C, pattern programming questions

C Programming
C Programming

Wing Pattern Programming, Butterfly pattern Programming, pattern program in java, pattern program in C, pattern programming questions

 

*         *
* *     * *
* * * * * *
* *     * *
*         *

 

 

#include<stdio.h>
int main(int argc, char const *argv[])
{
printf("enter the value of n :");
int n;scanf("%d",&n);
int s=0;int j1=0;
if(n%2==1)
{
s=n/2+1;j1=n+1;
for(int i=1;i<=n;i++)
{
int j=j1;int l=1;
if(i<=s)
{
for(int c=1;c<=i;c++)
{
printf("*");
j--;l++;
}
for(int c=j;c>=l;c--)
{
printf(" ");
j--;
}
}
else
{ 
for(int c=j1;c>i;c--)
{
printf("*");
j--;l++;
}
int copy=j;
for(int c=l;c<=copy;c++)
{
printf(" ");
j--;
}
}
while(j>0)
{
printf("*"); 
j--;
}
printf("\n");
}
}
else
{
s=n/2;j1=n+1;
for(int i=1;i<=n;i++)
{
int j=j1;int l=1;
if(i<=s)
{
for(int c=1;c<=i;c++)
{
printf("*");
j--;l++;
}
for(int c=j-1;c>=l;c--)
{
printf(" ");
j--;
}
}
else
{
for(int c=j1;c>i;c--)
{
printf("*");
j--;l++;
}
int copy=j;
for(int c=l+1;c<=copy;c++)
{
printf(" ");
j--;
}
}
while(j>1)
{
printf("*"); 
j--;
}
printf("\n");
}
}
return 0;
}

 

Program by Anshul

 


 

Topics Covered :

  • pattern printing
  • start pattern program in java
  • pattern printing programs
  • patterns in c++
  • pattern questions in reasoning
  • pattern questions in coding
  • pattern questions in java
  • solve pattern questions
  • pattern questions in aptitude
  • hill pattern
  • pattern questions apna college
  • pattern questions in interview
  • interview preparation course
  • diamond pattern
  • how to solve pattern questions in coding
  • triangle pattern
  • simply coding
  • information technology
  • simplycoding

 


 

 


 

Thanks for reading this blog. Hope you get satisfied with the blog and definitely this blog must have valued your time and effort of reading.

Take a time to connect our other digital creations such as Instagram , Facebook and Youtube.

 

🧑‍💻🧑‍💻 Social Media Links of Tech DCode :

👉🏻 YouTube : https://www.youtube.com/channel/UCjJnEdeugftBwQ3yMuD4B_A
👉🏻 Instagram : https://www.instagram.com/thetechdcode/
👉🏻 Facebook Page : https://www.facebook.com/thetechdcode
👉🏻 Twitter : https://twitter.com/thetechdcode
👉🏻 Telegram Channel : https://t.me/thetechdcode
👉🏻 Tech DCode Linktree : https://linktr.ee/thetechdcode
👉🏻 My Personal Handles : https://linktr.ee/virtualshivamin

🧑‍💻🧑‍💻 Social Media Links of SHIVAM SINGH (OWNER) :

👉🏻 Instagram : https://www.instagram.com/virtualshivamin/
👉🏻 Facebook Page : https://www.facebook.com/virtualshivamin/
👉🏻 Twitter : https://twitter.com/virtualshivamin/
👉🏻 Personal Linktree : https://linktr.ee/virtualshivamin 

 

Leave a Reply

Your email address will not be published. Required fields are marked *