Top 5 program of C - Language you must have learn

Top 5 Program of C language

Top 5 program in C language

     If you know C language and want to expand your editing skills further, this post is for you, in today's post we will talk about, TOP 5 Program in C Language. You all know that C is an intermediate language, unix programming code is written in C langauge, and in this post you will find the Top 5 program in C language. Today's post is based on a pattern plan. This means that in today's post, we will create certain types of patterns and we will also see their writing.
 To be able to improve your editing skills, and increase your editing skills. If you have ever made a diamond pattern pattern in C language, you will definitely understand this top 5 pattern in C language, because in this post we will see a high quality diamond print, Hello Friends my name is Tanmay And welcome, on the blog and the new top 5 program in the C language.

TOP 5 PROGRAM IN C LANGUAGE.-2020

Based on every 5 loops in the loops, and you will know how important a loop is in C language, if you learn to use loops in C language, then you will have no difficulty learning another language. In this top 5 program in C language, we will only use a loop, and with the help of that we will build all the patterns of the pattern, so let's get started.

1. Triangle System In C Language.

        This program has been asked many times in the trial, so we hope you will understand the program better. In this program I have linked two 90 degree triangles. When you see the output, you will understand what the concept of this program is, although this program is similar to all of the above programs, then you will not have a problem understanding. This program also uses the user, which means that the system will not work until the user enters the value. See this output.

pyramid pattern In C langauge


#include<stdio.h>
#include<conio.h>
main()
{
int x,y,z,a,b;
clrscr();
printf("Enter length of pattern\n");
scanf("%d",&z);
x=z;
y=z;
for(a=1;a<=z;a++)
{
for(b=1;b<z*2;b++)
{
if(b>x && b<y)/*And operator*/
{
printf(" ");/*single space */

}
else
{
printf("*");/* do not space after(*) */
}
}
x--;
y++;
printf("\n");
}
getch();
}
To make this program, we used 5 variables, so that the triangle pattern could be improved. Only the loop is used in this program. We hope you enjoyed the program. Let’s take a look at our final plan.

2. Pyramid Pattern In C language.

This pattern is frequently asked in the test, and along with the diamond pattern is also asked, in terms of testing, these patterns are very important. So today we will learn to make a pyramid pattern in the C language. In this program we will only use a loop to create this program, using 7 numerical variables. Where the change will take data input from the user. And we used 9 loop in this program. First, you see the output.

pyramid pattern IN C language

#include<stdio.h>
#include<conio.h>
main()
{
int he,gap,a,b,c,n,x=1;
clrscr();
printf("Enter the height of the pyramid\n");
scanf("%d",&he);/* give the value between 5 to 20 ,because screen not cover of pyramid size*/
gap=he-1;
for(a=1;a<=he;a++)
{
for(n=1;n<=he;n++)
{
printf(" ");
}
for(c=gap;c>=a;c--)
{
printf(" ");
}
for(b=1;b<=a;b++)
{
printf("* ");/* give a singal space after (*) */
}
printf("\n");
}
for(a=0;a<he;a++)
{
for(b=gap;b>a;b--)
{
printf(" ");
}
for(c=0;c<=a;c++)
{
printf("* ");/* give a singal space after (*) */
}
for(n=(he+he-2);n>=x;n--)
{
printf(" ");
}
for(c=0;c<=a;c++)
{
printf("* ");/* give a singal space after (*) */
}
x+=2;
printf("\n");
}
getch();
}


     If you do not understand this program, then comment, I will send you a link to the video. Although this process is very complex, it can be easily understood. And you have to give one space after
all * in the system, otherwise the pyramid will not be completely printed. But if you still have a problem, you can ask us in the comments. Let's look at the fourth plan.

3. Heart Program in C language .

This is the first program of our post, where we will learn to create a heart with the help of C language, and at the same time you will get the code, so you can understand the code better, and we hope you will understand, first I see the result of this program, and then we will talk about its coding .

heart program in C language
Look at the output and think about how the system might work, where you will print the space and where *. And to create this pattern using 8 logs, it is very easy to create a program, you have to understand its understanding, and with this we have announced the full number of three-digit variables, where the variable user input number will take, and therefore the heart size will be larger, meaning this pattern is based on user program.

#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c;
printf("Enter your desire value\n");
scanf("%d",&c);
for(a=c/2;a<c;a+=2)
{
for(b=1;b<(c-a);b+=2)
{
printf(" ");
}
for(b=1;b<=a;b++)
{
printf("*");
}
for(b=1;b<=(c-a);b++)
{
printf(" ");
}
for(b=1;b<=a;b++)
{
printf("*");
}
printf("\n");
}
for(a=c;a>=1;a--)
{
for(b=a;b<c;b++)
{
printf(" ");
}

for(b=1;b<=(a*2)-1;b++)
{
printf("*");
}
printf("\n");
}
getch();
}

You can run this program by copying and pasting this code into any of your C-language editors, if you find an error while using the application, then leave a
comment, and then your error will be resolved | So let’s take a look at another pattern system.


4. X-MAS Tree In Language C.

Yes friends, in this program we will see how to make an X-MAS tree, this program is difficult, but we hope you will understand for sure, but if you have a problem you can ask for comments, another syntax in this program we should keep in mind, if any syntax is wrong then the X-MAS tree pattern will not be printed. First, consider the effect that this program has on us.

X-mas tree program in c language

#include<stdio.h>
#include<conio.h>

int main()
{
 int a,b,c,he,wi,gap,r=1,m=1;

clrscr();

printf("Enter X-MAS tree height");
scanf("%d",&he);
printf("Enter X-MAS tree width");
scanf("%d",&wi);
gap=wi*5;
for(r=1;r<=he;r++)
{
for(a=m;a<=wi;a++)
{
for(b=gap;b>=a;b--)
{
printf(" ");
}
for(c=1;c<=a;c++)
{
printf("* ");/*give a single space after (* ) */
}
printf("\n");
}
m+=2;
wi+=2;
}
for(a=1;a<=4;a++)
{
for(b=gap-3;b>=1;b--)
{
printf(" ");
}
for(c=1;c<=4;c++)
{
printf("* "); /*give a single space after (* ) */
}
printf("\n");
}
getch();
}

    Minimum Height : 5
    Minimum width : 5
This program is also based on the user program, Since the user does not enter the number in it, the system will not work, and you must enter from 5 to 20 values ​​in this program, because if you enter a larger value, the X-mas tree size will be too large and will not displayed on your computer screen, so let's take a look at the third program

5.Square Pattern in System C.

This is the simplest program in this post, in this program we will learn to draw a square. This program is known to almost everyone. No problem even if you don't know. Now you will read this program easily. First, consider the effect that this program has on us.

square in c language


#include<stdio.h>
#include<conio.h>
main()
{
int y=9,x=y/2+1,a,b;
clrscr();
for(a=1;a<=y;a++)
{
for(b=1;b<=y;b++)
{
if(b==x||b==y-x+1)
{
printf("*");
}
else
printf(" ");
}
if(a<=y/2)
x--;
else
x++;
printf("\n");
}
getch();
}

You should have noticed that we used 4 variables to create this program, so you can copy and run this program by attaching it to any C IDE. If you have a problem, you can comment.

So friends, these were the top 5 programs in C language-2020, we hope you will like all these programs, if you like this post, then you will definitely tell me by commenting, and do not forget to share this post, as well as  Make sure to subscribe  the blog through Comment, so that whenever a new post arrives on the blog, its notification can reach you.

Tags :
pattern program in c basic,
christmas tree pattern program in c,
c program pattern using for loop,
c program for pattern of stars,
c program to generate pattern of stars,
pattern program in c with explanation,

Post a Comment

2 Comments

  1. I really admire you writing style and the article you had written Which is very interesting keep posting. Explore thousand of online certification courses such as Accounting for Begginers Tutorial, Digital Marketing Tutorial, How to FAQ the coder's brain?, Cloud Computing Tutorial or many more.

    ReplyDelete