Best C Programing Code For Several Pattern Printing (December,2020)

Pattern printing in C language

Firstly, I will request the visitor to run this code in their PC. It will help them to properly understand the code and output as well. This code will print 1 and 0 in alternative position of the pyramid.

For understanding this code properly you can visit : https://www.youtube.com/channel/UC51-9SUu0-CaAYwT4XLNtSw

#include<stdio.h>

int main()
{
int h,i,j,k=1;
printf("Enter the height");
scanf("%d",&h);
for(i=1;i<=h;i++)
{
for(j=1;j<=i;j++)
{
printf("%d ",k++%2);//1 0 1 0
}
printf("\n");
}
} 

Pattern printing in C language

First of all, I will request the visitor to run this code in their PC. It will help them to properly understand the code and output as well. Moreover, This code will print 1 and 0 in alternative position in each row of the pyramid.

For understanding this code properly you can visit : https://www.youtube.com/channel/UC51-9SUu0-CaAYwT4XLNtSw

#include<stdio.h>

int main()
{
int h,i,j;

printf("Enter the height");
scanf("%d",&h);

for(i=1;i<=h;i++)
{
 for(j=1;j<=i;j++)
  {
    printf("%d ",j%2);
  }
 printf("\n");
}
}

Pattern printing in C language

Firstly, I will request the visitor to run this code in their PC. It will help them to properly understand the code and output as well. Moreover, This code will print alphabets in diamond shape with spaces in between. In this code height of the upper portion is input. The lower side is designed accordingly.

For understanding this code properly you can visit : https://www.youtube.com/channel/UC51-9SUu0-CaAYwT4XLNtSw

#include<stdio.h>

int main()
{
int h,i,j;

printf("Enter the height");
scanf("%d",&h);

for(i=1;i<=h;i++)
{
 for(j=1;j<20-i;j++)
  printf("  ");
 for(j=1;j<=i;j++)
  {
  if(j==1 || j==i)
  printf("%c ",64+j);
  else
  printf("  ");
  }
 for(j=j-2;j>=1;j--)
  {
  if(j==1 || j==j-2)
   printf("%c ",64+j);
  else
   printf("  ");
  }
 printf("\n");
}
for(i=h-1;i>=1;i--)
{
 for(j=1;j<20-i;j++)
  printf("  ");
 for(j=1;j<=i;j++)
  {
  if(j==1 || j==i)
  printf("%c ",64+j);
  else
  printf("  ");
  }
 for(j=j-2;j>=1;j--)
  {
  if(j==1 || j==j-2)
  printf("%c ",64+j);
  else
  printf("  ");
  }
 printf("\n");
}
}

Pattern printing in C language

First of all, I will request the visitor to execute this code in their PC. It will help them to properly understand the code and output as well. As a result, This code will print alphabets in diamond shape. In this code height is the input for upper portion of the triangle. Lower portion is designed accordingly.

For understanding this code properly you can visit : https://www.youtube.com/channel/UC51-9SUu0-CaAYwT4XLNtSw

#include<stdio.h>

int main()
{
int h,i,j;

printf("Enter the height");
scanf("%d",&h);

for(i=1;i<=h;i++)
{
 for(j=1;j<20-i;j++)
  printf("  ");
 for(j=1;j<=i;j++)
  printf("%c ",64+j);
 for(j=j-2;j>=1;j--)
  printf("%c ",64+j);
 printf("\n");
}
for(i=h-1;i>=1;i--)
{
 for(j=1;j<20-i;j++)
  printf("  ");
 for(j=1;j<=i;j++)
  printf("%c ",64+j);
 for(j=j-2;j>=1;j--)
  printf("%c ",64+j);
 printf("\n");
}
}

Pattern printing in C language

First of all, I will request the visitor to run this code in their PC. It will help them to properly understand the code and output as well. As a result, this code will print alphabets in triangular shape.

For understanding this code properly you can visit : https://www.youtube.com/channel/UC51-9SUu0-CaAYwT4XLNtSw

#include<stdio.h>

int main()
{
int h,i,j;

printf("Enter the height");
scanf("%d",&h);

for(i=1;i<=h;i++)
{
 for(j=1;j<20-i;j++)
  printf("  ");
 for(j=1;j<=i;j++)
  printf("%c ",64+j);//123//ABC
 for(j=j-2;j>=1;j--)
  printf("%c ",64+j);//21//BA      ABCBA
 printf("\n");
}
}

Pattern printing in C language

Firstly, I will request the visitor to run this code in their PC. It will help them to properly understand the code and output as well. As a result, This code will print numbers in a triangular shape. Numbers will be printed in ascending and then descending order in each row.

For understanding this code properly you can visit : https://www.youtube.com/channel/UC51-9SUu0-CaAYwT4XLNtSw

#include<stdio.h>

int main()
{
int h,i,j;

printf("Enter the height");
scanf("%d",&h);

for(i=1;i<=h;i++)
{
 for(j=1;j<11-i;j++)
  printf("  ");
 for(j=1;j<=i;j++)
  printf("%2d",j);
 for(j=j-2;j>=1;j--)
  printf("%2d",j);
 printf("\n");
}
}

Pattern printing in C language

First of all, I will request the visitor to run this code in their PC. It will help them to properly understand the code and output as well. As a result, This code will print star in diamond shape. This code will take height as input for upper portion and lower part is calculated accordingly.

For understanding this code properly you can visit : https://www.youtube.com/channel/UC51-9SUu0-CaAYwT4XLNtSw

#include<stdio.h>

int main()
{
int h,i,j;

printf("Enter the height");
scanf("%d",&h);

for(i=1;i<=h;i++)
{
 for(j=1;j<40-i;j++)
  printf(" ");
 for(j=1;j<=i;j++)
  printf("* ");
 printf("\n");
}
for(i=h-1;i>=1;i--)//4, 3
{
 for(j=1;j<40-i;j++)//32
  printf(" ");
 for(j=1;j<=i;j++)//j=1..4 -----   1..3 ------  1..2 ---  1..1
  printf("* ");
 printf("\n");
}
}

Pattern printing in C language

Firstly, I will request the visitor to run this code in their PC. It will help them to properly understand the code and output as well. As a result, This code will print alphabets in reverse order in a lower triangle like shape.

For understanding this code properly you can visit : https://www.youtube.com/channel/UC51-9SUu0-CaAYwT4XLNtSw

#include<stdio.h>

void main()
{
int p=65,n,m,i,j,t;

printf("\nEnter the height of the pattern : ");
scanf("%d",&n);
printf("\n\n");
for(i=n-1;i>=0;i--)
{
p=65+i;
for(j=0;j<n-i;j++)
printf(" ");
for(j=0;j<=i;j++)
printf("%c ",p--);
printf("\n");
}
}

Pattern printing in C language

First of all, I will request the visitor to run this code in their PC. It will help to properly understand the code and output as well. As a result, This code will print alphabets with calculated space in between. Moreover, I would like to request for taking height as odd number. Because, this code will take odd height. Lastly, I would like to say that a very small change is required for taking any height as input. If you can put a comment regarding your queries or confusion.

For understanding this code properly you can visit : https://www.youtube.com/channel/UC51-9SUu0-CaAYwT4XLNtSw

#include<stdio.h>

void main()
{
char ch;
int i,j,m;

printf("Enter the height of the pattern " );
scanf("%d",&m);

for(i=0;i<=m/2;i++)
{
ch='A';
for(j=0;j<m;j++)
{
if(j>m/2-i && j<m/2+i)
printf(" ");
else
printf("%c",ch);

if(j>=m/2)
ch--;
else
ch++;

}
printf("\n");
}
}

Pattern printing in C language

Firstly, I will request the visitor to run this code in their PC. It will help to properly understand the code and output as well. As a result, This code will print alphabets in triangular shape.

For understanding this code properly you can visit : https://www.youtube.com/channel/UC51-9SUu0-CaAYwT4XLNtSw

#include<stdio.h>

int main()
{
int h,i,j;

printf("Enter the height");
scanf("%d",&h);

for(i=1;i<=h;i++)
{
 for(j=1;j<40-i;j++)
  printf(" ");
 for(j=1;j<=i;j++)
  printf("%c ",64+j);
 printf("\n");
}
}

Pattern printing in C language

Firstly, I will request the visitor to run this code in their PC. It will help them to properly understand the code and output as well. As a result, This code will print alphabets in triangular shape.

For understanding this code properly you can visit : https://www.youtube.com/channel/UC51-9SUu0-CaAYwT4XLNtSw

#include<stdio.h>

int main()
{
int h,i,j;

printf("Enter the height");
scanf("%d",&h);

for(i=1;i<=h;i++)
{
 for(j=1;j<40-i;j++)//39 , 38   ,37  , 36 
  printf(" ");
 for(j=1;j<=i;j++)
  printf("%c ",64+i);
 printf("\n");
}
}

Pattern printing in C language

First of all, I will request the visitor to run this code in their PC. It will help them to properly understand the code and output as well. Moreover, I have executed this code in Turbo C editor for printing # and $ in calculated position. Lastly, these symbols will be printed with different color and different sound.

For understanding this code properly you can visit : https://www.youtube.com/channel/UC51-9SUu0-CaAYwT4XLNtSw

#include<stdio.h>
#include<conio.h>
#include<dos.h>
void main()
{
int i,j,m,k=1,t=1;//,g;
clrscr();
printf("enter the height");
scanf("%d",&m);
printf("\n\n");
for(i=0;i<m;i++)
{
for(j=0;j<m;j++)
{
textcolor(t);
textbackground(t+1);
t++;
sound(30*(k++)*2);
if((i==0 || i==m-1) || (j==0 || j==m-1))
cprintf(" *");
else if(i==j)
cprintf(" $");
else
cprintf(" #");
delay(100);
}
printf("\n");
}
nosound();
getch();
}

Pattern printing in C language

First of all, I will request the visitor to run this code in their PC. It will help them to properly understand the code and output as well. As a result, This code will print * and $ symbol at proper position with proper space.

For understanding this code properly you can visit : https://www.youtube.com/channel/UC51-9SUu0-CaAYwT4XLNtSw

#include<stdio.h>

int main()
{
int i,j,m;

printf("Enter the height  of the pattern : ");
scanf("%d",&m);

for(i=0;i<m;i++)
{
for(j=0;j<m;j++)
{
if(i==0 || i==m-1)
printf(" * ");
else if(j==0 || j==m-1)
printf(" * ");
else if(i==j)
printf(" $ ");
else
printf("   ");
}
printf("\n");
}
}

This Post Has 142 Comments

  1. Jacques

    I like the helpful information you provide to your articles.

    I will bookmark your blog and check again here regularly.
    I’m reasonably sure I will be informed a lot of new stuff
    proper here! Best of luck for the following!

  2. mega888 malaysia

    Hello Dear, are you actually visiting this web site on a regular basis, if so then you
    will absolutely get fastidious knowledge.

    Feel free to surf to my webpage: mega888 malaysia

  3. ex88

    With havin so much content and articles do you ever run into any issues of plagorism or copyright
    violation? My website has a lot of exclusive content I’ve either authored myself or
    outsourced but it seems a lot of it is popping it
    up all over the web without my authorization. Do you know any
    solutions to help prevent content from being stolen? I’d certainly appreciate it.

    my blog post: ex88

  4. 918Kaya New

    I all the time used to study piece of writing in news papers but now as I am a user of net
    therefore from now I am using net for articles, thanks to web.

    Also visit my web-site – 918Kaya New

  5. You really make it appear really easy with your presentation however I to find this matter to
    be really something that I feel I might by no
    means understand. It kind of feels too complex and
    very broad for me. I am taking a look forward for your subsequent put up, I will attempt to get the hold of
    it!

    Here is my webpage – kiss 918 download for android

  6. mega988

    Hello, i read your blog occasionally and i own a similar one and i was just wondering if you get
    a lot of spam remarks? If so how do you reduce it, any plugin or
    anything you can advise? I get so much lately it’s driving
    me crazy so any help is very much appreciated.

    Also visit my homepage :: mega988

  7. pussy888 dow

    I would like to thank you for the efforts you’ve put
    in penning this blog. I’m hoping to view the same high-grade content from you in the future as well.
    In fact, your creative writing abilities has motivated me to
    get my own, personal website now 😉

    Feel free to surf to my web blog – pussy888 dow

  8. ZS

    Thank you, I’ve just been looking for info about this topic for a long time and yours is the best I’ve found out till now.

    But, what in regards to the bottom line? Are
    you sure about the source?

  9. mega888 company

    I always emailed this webpage post page to all my associates,
    for the reason that if like to read it then my links
    will too.

    Stop by my web-site … mega888 company

  10. It’s actually a nice and helpful piece of information. I’m happy that
    you shared this useful information with us. Please stay us
    up to date like this. Thank you for sharing.

    My webpage; mega888apk download

  11. ex88

    I was suggested this web site through my
    cousin. I am now not sure whether or not this put up
    is written through him as nobody else recognize such specified approximately my problem.

    You are incredible! Thank you!

    Also visit my web-site; ex88

  12. What’s Happening i am new to this, I stumbled upon this I have discovered It positively helpful and it has helped me out loads.
    I’m hoping to contribute & aid different users like
    its aided me. Good job.

    my web-site; mega888 original [http://www.lefeverbasteyns.be]

  13. kiss916

    Spot on with this write-up, I actually feel this amazing site needs far more attention. I’ll probably be
    back again to read through more, thanks for the advice!

    Also visit my site :: kiss916

  14. mega888 ios

    I’m not that much of a internet reader to be
    honest but your blogs really nice, keep it up! I’ll go ahead and bookmark
    your site to come back later on. Many thanks

    Also visit my web-site: mega888 ios

  15. 918kiss

    Right away I am ready to do my breakfast, after having my breakfast coming again to read additional news.

    My website 918kiss

  16. I do not even know how I ended up right here, but I thought this submit used to
    be great. I don’t know who you might be however certainly you’re going to a well-known blogger for those who aren’t already.
    Cheers!

    Check out my webpage pussy888 apk download

  17. t.me

    Thank you for the auspicious writeup. It in fact was a amusement account it.

    Look advanced to more added agreeable from you!
    By the way, how can we communicate?

  18. pmso.in

    This piece of writing will assist the internet visitors for setting up new web site or even a blog from
    start to end.

    Feel free to visit my web page :: mega888apk download (pmso.in)

  19. 918kaya game

    Nice post. I was checking constantly this blog and I am impressed!
    Extremely helpful info particularly the last part 🙂 I care for such information much.
    I was looking for this particular information for
    a long time. Thank you and good luck.

    my web page – 918kaya game

  20. I got this web page from my friend who shared with me regarding this web site
    and at the moment this time I am visiting this website and reading
    very informative articles at this time.

    Here is my page … 918kaya kiosk – http://www.herodungeons.com,

  21. I truly love your website.. Pleasant colors &
    theme. Did you make this amazing site yourself? Please reply
    back as I’m attempting to create my own personal website and would like to find out where you got this from or what the theme
    is called. Cheers!

    Here is my web page; download pussy888 apk ios

  22. A fascinating discussion is worth comment. I do think that
    you should publish more about this subject, it may not be a taboo subject but typically people don’t talk about these topics.
    To the next! Many thanks!!

    my web-site :: mega888 original; http://www.sassypublications.co.uk,

  23. list game xe88

    This web site really has all of the information and facts I wanted about this
    subject and didn’t know who to ask.

    My homepage – list game xe88

  24. What’s up mates, good post and nice arguments commented at this place, I am genuinely enjoying by these.

  25. download mega888

    Hi my loved one! I want to say that this article is awesome, great written and include almost all important
    infos. I would like to see extra posts like this .

    my web site :: download mega888

  26. hello!,I love your writing very so much! share we communicate more approximately your post on AOL?

    I need an expert on this area to unravel my problem.
    May be that is you! Taking a look ahead to peer you.

    Also visit my blog :: http://www.biaozhuxinxi.com

  27. My partner and I stumbled over here by a different web page and thought I may as well check
    things out. I like what I see so now i am following
    you. Look forward to looking at your web page repeatedly.

    Here is my blog post download aplikasi 918kaya

  28. progz.hu

    I would like to thank you for the efforts you’ve put in penning
    this blog. I’m hoping to check out the same high-grade blog posts from you
    later on as well. In fact, your creative writing abilities has inspired me to get my own blog now 😉

  29. It’s genuinely very complex in this busy life to listen news on Television, so
    I only use world wide web for that purpose, and get the hottest information.

  30. freeholmes.com

    It’s very effortless to find out any matter on net as compared to textbooks, as I found this paragraph at this site.

    Also visit my website freeholmes.com

  31. Incredible! This blog looks exactly like my old one!

    It’s on a totally different subject but it has
    pretty much the same layout and design. Excellent choice of colors!

  32. Kathrin

    Spot on with this write-up, I seriously believe that this site needs much more attention. I’ll
    probably be back again to see more, thanks for the advice!

    My web page – xe88; Kathrin,

  33. Howdy I am so glad I found your weblog, I really found you by mistake,
    while I was searching on Bing for something else, Anyways I am here now
    and would just like to say thanks for a fantastic post
    and a all round interesting blog (I also love the theme/design), I don’t have time to
    go through it all at the moment but I have bookmarked it and also added
    in your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the fantastic jo.

  34. freeholmes.com

    Pretty component to content. I just stumbled upon your blog and in accession capital to claim that I get in fact enjoyed account
    your blog posts. Anyway I will be subscribing on your feeds or even I
    success you get entry to constantly fast.

    Also visit my website – 918kaya (freeholmes.com)

  35. 737efb.online

    We are a gaggle of volunteers and opening
    a new scheme in our community. Your website provided us with useful information to work on.
    You’ve done a formidable activity and our whole group might be grateful to you.

  36. 2xex.com

    I’m not sure why but this weblog is loading incredibly slow for me.

    Is anyone else having this issue or is it a problem on my end?
    I’ll check back later on and see if the problem still exists.

    Stop by my blog :: 2xex.com

  37. We are a group of volunteers and starting a new scheme
    in our community. Your web site offered us with valuable info to work on. You
    have done a formidable job and our entire community will be thankful
    to you.

  38. kebe.top

    Hi there, I discovered your site by means of Google even as searching
    for a comparable matter, your web site got here up,
    it looks great. I have bookmarked it in my google bookmarks.[X-N-E-W-L-I-N-S-P-I-N-X]Hello
    there, simply became alert to your weblog through Google, and
    located that it’s really informative. I am going to watch out for brussels.
    I’ll appreciate in the event you continue this in future.
    Numerous other folks might be benefited out of your writing.

    Cheers!

    Have a look at my blog post :: kebe.top

  39. xe888 apk

    hi!,I like your writing very so much! proportion we communicate extra about
    your post on AOL? I require a specialist in this space to unravel my problem.

    May be that’s you! Having a look ahead to look you.

    Here is my homepage … xe888 apk

  40. this contact form

    Thanks for the marvelous posting! I genuinely enjoyed reading it,
    you can be a great author. I will make certain to bookmark your blog and
    will often come back in the foreseeable future. I want to encourage you
    to definitely continue your great work, have a nice afternoon!

  41. www.012803.cn

    Hello to every body, it’s my first pay a quick visit of this weblog; this blog consists of awesome and truly
    fine stuff designed for readers.

    my web page: http://www.012803.cn

  42. maps.google.com

    I like the helpful information you supply to your articles.
    I will bookmark your blog and check once more here frequently.
    I’m rather certain I will learn many new stuff right right here!
    Good luck for the following!

  43. Michale

    Please let me know if you’re looking for a author for your site.

    You have some really good posts and I feel I would be a good asset.
    If you ever want to take some of the load off, I’d really like to write some articles for your blog in exchange for a link back to mine.
    Please shoot me an e-mail if interested. Thank you!

    Here is my page: xe88 download – Michale,

  44. his response

    I think this is among the most vital information for me.
    And i am glad reading your article. But should remark on some general things,
    The web site style is great, the articles is really excellent
    : D. Good job, cheers

  45. Gaye

    You are a very bright individual!

    my website :: Gaye

  46. It’s appropriate time to make some plans for
    the future and it is time to be happy. I have read this
    post and if I could I desire to suggest you some interesting things or tips.
    Maybe you could write next articles referring to this article.
    I wish to read more things about it!

    Feel free to visit my homepage; https://www.minerva.gallery

  47. slot online

    Hello there! This post could not be written any better!

    Reading this post reminds me of my old room mate! He always
    kept chatting about this. I will forward
    this page to him. Fairly certain he will have a good read.

    Thank you for sharing!

  48. Lighting Replica

    This is really fascinating, You’re an excessively professional blogger.
    I’ve joined your rss feed and look forward to searching for more of
    your fantastic post. Also, I have shared your web
    site in my social networks

  49. google

    Valuable info. Lucky me I found your website by
    chance, and I am shocked why this twist of fate didn’t took place earlier!
    I bookmarked it.

  50. I’ve been browsing online more than three hours lately,
    but I by no means discovered any attention-grabbing article like yours.

    It’s pretty worth enough for me. Personally, if all site
    owners and bloggers made good content material
    as you did, the internet can be much more helpful than ever before.

  51. It’s difficult to find knowledgeable people in this particular topic, but you sound like you know what you’re talking about!

    Thanks

  52. Hi! I know this is kind of off-topic however I had to ask.
    Does running a well-established website like yours take a large amount of work?
    I am brand new to blogging but I do write in my journal on a daily basis.
    I’d like to start a blog so I can easily share my experience and thoughts online.
    Please let me know if you have any suggestions or tips for
    new aspiring bloggers. Thankyou!

    1. Kumar Gourab

      thanks for your reply… it’s really easy in terms of money and effort… please contact creativeresource2020@gmail.com if you want a same website at very low budget or for any further query.. thank you once again…

  53. Oh my goodness! Awesome article dude! Thanks, However I am experiencing issues with your RSS.

    I don’t know the reason why I can’t subscribe to
    it. Is there anyone else having the same RSS issues?
    Anyone who knows the answer can you kindly respond?
    Thanx!!

    1. Kumar Gourab

      thanks a lot for your interest.. please subscribe using the side bar or footer subscribe section..

  54. Dbb casino

    Hello, after reading this remarkable article i am also glad
    to share my knowledge here with friends.

  55. Hello! Quick question that’s entirely off topic.
    Do you know how to make your site mobile friendly?
    My site looks weird when viewing from my iphone.
    I’m trying to find a theme or plugin that might be able to fix this problem.
    If you have any suggestions, please share. With thanks!

  56. dbbcasino

    Write more, thats all I have to say. Literally, it seems as though you relied on the video
    to make your point. You definitely know what youre talking
    about, why throw away your intelligence on just posting videos to your blog when you could be giving us something enlightening to read?

    1. Kumar Gourab

      thanks a lot for your reply. are you asking me to write books…???

  57. BBD

    Great weblog here! Additionally your website a lot
    up fast! What host are you the usage of? Can I
    get your affiliate link in your host? I desire
    my site loaded up as fast as yours lol

Leave a Reply to aroundsuannan.ssru.ac.th Cancel reply