24. Pattern 4
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
#include<stdio.h>
#include<conio.h>
void main()
{
int n, i, j;
printf("Enter number : ");
scanf("%d", &n);
for (i = 1; i <= n; i++)
{
for (j = 1; j <= i; j++)
{
printf("%d ", j);
}
printf("\n");
}
getch();
}
#pattern
@programming_and_coding
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
#include<stdio.h>
#include<conio.h>
void main()
{
int n, i, j;
printf("Enter number : ");
scanf("%d", &n);
for (i = 1; i <= n; i++)
{
for (j = 1; j <= i; j++)
{
printf("%d ", j);
}
printf("\n");
}
getch();
}
#pattern
@programming_and_coding
25. Pattern 5
1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
#include <stdio.h>
#include<conio.h>
void main()
{
int i, j, n;
printf("Enter number : ");
scanf("%d", &n);
printf("\n");
for (i = 1; i <= n; i++)
{
for (j = i; j >= 1; j--)
{
printf("%d ", j);
}
printf("\n");
}
getch();
}
#patternn
@programming_and_coding
1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
#include <stdio.h>
#include<conio.h>
void main()
{
int i, j, n;
printf("Enter number : ");
scanf("%d", &n);
printf("\n");
for (i = 1; i <= n; i++)
{
for (j = i; j >= 1; j--)
{
printf("%d ", j);
}
printf("\n");
}
getch();
}
#patternn
@programming_and_coding
Hello guyzz,π
Want to learn coding?
If your basic concept is strong then you can easily switch to any programming language efficiently.
This awesome channel on telegram will serve you C language program from basic to advance in a serial order that help you in crack any examination in effective way .
Check out this incomparable channel on telegram for all update and subscribe them to understand the concept of C language nd get a job in top MNC.
@programming_and_coding
@programming_and_coding
@programming_and_coding
@programming_and_coding
@programming_and_coding
Dear subscriber copy &paste this message to all group nd your friendlist to help them also.
Ad:- 1
C_Language_Coding
This channel will serve you C language program from basic to advance in a serial order that help you in understand the basic and crack any IT examination in easy way .
Invite other to Subscribe this channel on telegram
@Programming_and_Coding
https://t.me/programming_and_coding
Want to learn coding?
If your basic concept is strong then you can easily switch to any programming language efficiently.
This awesome channel on telegram will serve you C language program from basic to advance in a serial order that help you in crack any examination in effective way .
Check out this incomparable channel on telegram for all update and subscribe them to understand the concept of C language nd get a job in top MNC.
@programming_and_coding
@programming_and_coding
@programming_and_coding
@programming_and_coding
@programming_and_coding
Dear subscriber copy &paste this message to all group nd your friendlist to help them also.
Ad:- 1
C_Language_Coding
This channel will serve you C language program from basic to advance in a serial order that help you in understand the basic and crack any IT examination in easy way .
Invite other to Subscribe this channel on telegram
@Programming_and_Coding
https://t.me/programming_and_coding
Telegram
C_Language_Coding
This channel will serve you C language program from basic to advance in a serial order that help you in understand the basic and crack any IT examination in easy way .
Invite other to Subscribe this channel on telegram
@Programming_and_Coding
Invite other to Subscribe this channel on telegram
@Programming_and_Coding
GOOGLE Hiring Application Engineering Intern, Summer 2021
Last Date: 8 Dec 2020
Click Here to Applyπ
https://careers.google.com/jobs/results/89086682550149830-application-engineering-intern-summer-2021/
@programming_and_coding
#Update 1
Last Date: 8 Dec 2020
Click Here to Applyπ
https://careers.google.com/jobs/results/89086682550149830-application-engineering-intern-summer-2021/
@programming_and_coding
#Update 1
26. Pattern 6
A
B C
D E F
G H I J
K L M N O
#include<stdio.h>
#include<conio.h>
void main()
{
int i, j, n;
clrscr();
printf("Enter number : ");
scanf("%d", &n);
int c = 'A';
for (i = 0; i < n; i++)
{
for (j = 0; j <= i; j++)
{
printf("%c", c);
c = c + 1;
}
printf("\n");
}
getch();
}
#pattern
@programming_and_coding
A
B C
D E F
G H I J
K L M N O
#include<stdio.h>
#include<conio.h>
void main()
{
int i, j, n;
clrscr();
printf("Enter number : ");
scanf("%d", &n);
int c = 'A';
for (i = 0; i < n; i++)
{
for (j = 0; j <= i; j++)
{
printf("%c", c);
c = c + 1;
}
printf("\n");
}
getch();
}
#pattern
@programming_and_coding
27. Pattern 7
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1
#include<stdio.h>
#include<conio.h>
void main()
{
int i, j, n;
clrscr();
printf("Enter number : ");
scanf("%d", &n);
for (i = 1; i <= n; i++)
{
for (j = 1; j <= i; j++)
{
printf("%d", j);
}
for (j = i - 1; j >= 1; j--)
{
printf("%d", j);
}
printf("\n");
}
getch();
}
#pattern
@programming_and_coding
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1
#include<stdio.h>
#include<conio.h>
void main()
{
int i, j, n;
clrscr();
printf("Enter number : ");
scanf("%d", &n);
for (i = 1; i <= n; i++)
{
for (j = 1; j <= i; j++)
{
printf("%d", j);
}
for (j = i - 1; j >= 1; j--)
{
printf("%d", j);
}
printf("\n");
}
getch();
}
#pattern
@programming_and_coding
28. Pattern 8 (Binary Pattern)
1
0 1
1 0 1
0 1 0 1
1 0 1 0 1
#include<stdio.h>
#include<conio.h>
void main()
{
int i, j;
int count = 1;
clrscr();
for (i = 1; i <= 5; i++)
{
for (j = 1; j <= i; j++)
{
printf("%d", count++ % 2);
if (j == i && i != 5)
printf("\n");
}
if (i % 2 == 0)
count = 1;
else
count = 0;
}
getch();
}
#pattern
@programming_and_coding
1
0 1
1 0 1
0 1 0 1
1 0 1 0 1
#include<stdio.h>
#include<conio.h>
void main()
{
int i, j;
int count = 1;
clrscr();
for (i = 1; i <= 5; i++)
{
for (j = 1; j <= i; j++)
{
printf("%d", count++ % 2);
if (j == i && i != 5)
printf("\n");
}
if (i % 2 == 0)
count = 1;
else
count = 0;
}
getch();
}
#pattern
@programming_and_coding
29. Pattern 9
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
#include<stdio.h>
#include<conio.h>
void main()
{
int i, j, k, l, n;
clrscr();
printf("Enter number : ");
scanf("%d", &n);
printf("\n");
for (i = n; i >= 1; i--)
{
for (j = 1; j <= i; j++)
printf("%d", j);
printf("\n");
}
getch();
}
@programming_and_coding
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
#include<stdio.h>
#include<conio.h>
void main()
{
int i, j, k, l, n;
clrscr();
printf("Enter number : ");
scanf("%d", &n);
printf("\n");
for (i = n; i >= 1; i--)
{
for (j = 1; j <= i; j++)
printf("%d", j);
printf("\n");
}
getch();
}
@programming_and_coding
30. Pattern 10
1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
#include<stdio.h>
#include<conio.h>
void main()
{
int i, j, k;
clrscr();
for (i = 1; i <= 5; i++)
{
for (j = 5; j >= 1; j--)
{
if (j <= i)
{
printf("%d", j);
}
else
{
printf(" ");
}
}
printf("\n");
}
getch();
}
@programming_and_coding
1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
#include<stdio.h>
#include<conio.h>
void main()
{
int i, j, k;
clrscr();
for (i = 1; i <= 5; i++)
{
for (j = 5; j >= 1; j--)
{
if (j <= i)
{
printf("%d", j);
}
else
{
printf(" ");
}
}
printf("\n");
}
getch();
}
@programming_and_coding
31. Pattern 11
1 1
1 2 2 1
1 2 3 3 2 1
1 2 3 4 4 3 2 1
#include<stdio.h>
#include<conio.h>
void main()
{
int i, j, k;
clrscr();
for (i = 1; i <= 5; i++)
{
for (j = 1; j <= 5; j++)
{
if (j <= i)
{
printf("%d ", j);
}
else
{
printf(" ");
}
}
for (j = 5; j >= 1; j--)
{
if (j <= i)
{
printf("%d ", j);
}
else
{
printf(" ");
}
}
printf("\n");
}
getch();
}
@programming_and_coding
1 1
1 2 2 1
1 2 3 3 2 1
1 2 3 4 4 3 2 1
#include<stdio.h>
#include<conio.h>
void main()
{
int i, j, k;
clrscr();
for (i = 1; i <= 5; i++)
{
for (j = 1; j <= 5; j++)
{
if (j <= i)
{
printf("%d ", j);
}
else
{
printf(" ");
}
}
for (j = 5; j >= 1; j--)
{
if (j <= i)
{
printf("%d ", j);
}
else
{
printf(" ");
}
}
printf("\n");
}
getch();
}
@programming_and_coding
32. Floyd's triangle
1
2 3
4 5 6
7 8 9 10
11 12 13 14
#include<stdio.h>
#include<conio.h>
void main()
{
int n, i, c, a = 1;
clrscr();
printf("Enter the number of rows : ");
scanf("%d", &n);
for (i = 1; i <= n; i++) {
for (c = 1; c <= i; c++) {
printf("%d ", a);
a++;
}
printf("\n");
}
getch();
}
@programming_and_coding
1
2 3
4 5 6
7 8 9 10
11 12 13 14
#include<stdio.h>
#include<conio.h>
void main()
{
int n, i, c, a = 1;
clrscr();
printf("Enter the number of rows : ");
scanf("%d", &n);
for (i = 1; i <= n; i++) {
for (c = 1; c <= i; c++) {
printf("%d ", a);
a++;
}
printf("\n");
}
getch();
}
@programming_and_coding
33. Pyramid
*
* *
* * *
* * * *
* * * * *
#include<stdio.h>
#include<conio.h>
void main()
{
int row, c, n, temp;
clrscr();
printf("Enter the number of rows : ");
scanf("%d", &n);
temp = n;
for (row = 1; row <= n; row++)
{
for (c = 1; c < temp; c++)
printf(" ");
temp--;
for (c = 1; c <= 2 * row - 1; c++)
printf("*");
printf("\n");
}
getch();
}
@programming_and_coding
*
* *
* * *
* * * *
* * * * *
#include<stdio.h>
#include<conio.h>
void main()
{
int row, c, n, temp;
clrscr();
printf("Enter the number of rows : ");
scanf("%d", &n);
temp = n;
for (row = 1; row <= n; row++)
{
for (c = 1; c < temp; c++)
printf(" ");
temp--;
for (c = 1; c <= 2 * row - 1; c++)
printf("*");
printf("\n");
}
getch();
}
@programming_and_coding
34. Pyramid 2
*
*A*
*A*A*
*A*A*A*
*A*A*A*A*
#include<stdio.h>
#include<conio.h>
void main()
{
int n, c, k, space, count = 1;
clrscr();
printf("Enter the number of rows : ");
scanf("%d", &n);
space = n;
for (c = 1; c <= n; c++)
{
for (k = 1; k < space; k++)
printf(" ");
for (k = 1; k <= c; k++)
{
printf("*");
if (c > 1 && count < c)
{
printf("A");
count++;
}
}
printf("\n");
space--;
count = 1;
}
getch();
}
@programming_and_coding
*
*A*
*A*A*
*A*A*A*
*A*A*A*A*
#include<stdio.h>
#include<conio.h>
void main()
{
int n, c, k, space, count = 1;
clrscr();
printf("Enter the number of rows : ");
scanf("%d", &n);
space = n;
for (c = 1; c <= n; c++)
{
for (k = 1; k < space; k++)
printf(" ");
for (k = 1; k <= c; k++)
{
printf("*");
if (c > 1 && count < c)
{
printf("A");
count++;
}
}
printf("\n");
space--;
count = 1;
}
getch();
}
@programming_and_coding
35. Number Pyramid
1
232
34543
4567654
567898765
#include<stdio.h>
#include<conio.h>
void main()
{
int n, c, d, num = 1, space;
clrscr();
printf("Enter the number of rows : ");
scanf("%d", &n);
space = n - 1;
for (d = 1; d <= n; d++)
{
num = d;
for (c = 1; c <= space; c++)
printf(" ");
space--;
for (c = 1; c <= d; c++)
{
printf("%d", num);
num++;
}
num--;
num--;
for (c = 1; c < d; c++)
{
printf("%d", num);
num--;
}
printf("\n");
}
getch();
}
@programming_and_coding
1
232
34543
4567654
567898765
#include<stdio.h>
#include<conio.h>
void main()
{
int n, c, d, num = 1, space;
clrscr();
printf("Enter the number of rows : ");
scanf("%d", &n);
space = n - 1;
for (d = 1; d <= n; d++)
{
num = d;
for (c = 1; c <= space; c++)
printf(" ");
space--;
for (c = 1; c <= d; c++)
{
printf("%d", num);
num++;
}
num--;
num--;
for (c = 1; c < d; c++)
{
printf("%d", num);
num--;
}
printf("\n");
}
getch();
}
@programming_and_coding
36. Pascal triangle
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
#include<stdio.h>
#include<conio.h>
long fact(int);
void main()
{
int line, i, j;
clrscr();
printf("Enter the number : ");
scanf("%d", &line);
for (i = 0; i < line; i++)
{
for (j = 0; j < line - i - 1; j++)
{
printf(" ");
}
for (j = 0; j <= i; j++)
{
printf("%ld ", fact(i) / (fact(j) * fact(i - j)));
}
printf("\n");
}
getch();
}
long fact(int num)
{
long f = 1;
int i = 1;
while (i <= num)
{
f = f * i;
i++;
}
return f;
}
@programming_and_coding
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
#include<stdio.h>
#include<conio.h>
long fact(int);
void main()
{
int line, i, j;
clrscr();
printf("Enter the number : ");
scanf("%d", &line);
for (i = 0; i < line; i++)
{
for (j = 0; j < line - i - 1; j++)
{
printf(" ");
}
for (j = 0; j <= i; j++)
{
printf("%ld ", fact(i) / (fact(j) * fact(i - j)));
}
printf("\n");
}
getch();
}
long fact(int num)
{
long f = 1;
int i = 1;
while (i <= num)
{
f = f * i;
i++;
}
return f;
}
@programming_and_coding
37. Pascal triangle without using function
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
#include<stdio.h>
#include<conio.h>
void main()
{
int x, y, n, a, z, s;
clrscr();
printf("Enter the number : ");
scanf("%d", &n);
s = n;
for (x = 0; x <= n; x++)
{
a = 1;
for (z = s; z >= 0; z--)
printf(" ");
s--;
for (y = 0; y <= x; y++)
{
printf("%d ", a);
a = (a * (x - y) / (y + 1));
}
printf("\n");
}
getch();
}
@programming_and_coding
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
#include<stdio.h>
#include<conio.h>
void main()
{
int x, y, n, a, z, s;
clrscr();
printf("Enter the number : ");
scanf("%d", &n);
s = n;
for (x = 0; x <= n; x++)
{
a = 1;
for (z = s; z >= 0; z--)
printf(" ");
s--;
for (y = 0; y <= x; y++)
{
printf("%d ", a);
a = (a * (x - y) / (y + 1));
}
printf("\n");
}
getch();
}
@programming_and_coding
β
Wipro Elite NLTH Announcement
Start Date: Reg. will start in a week
Last date: 5th Jan 2021
Online Exam: 11thβ17th Jan 2021
Batch: 2021 Passout
Eligibilty: B.E/B.Tech/5yrs Integ-M.Tech
Branch: CS/IT/Circuital
CTC: INR 3.50 lpa & 6.75 lpa
Syllabus:
Quant(16)+Log(16)+Ver(16)=16*3=48Mins
Essay(1)+Coding(2)=(20+60)Mins
- via Prepflix
Telegram: @programming_and_coding
#Update 2
Start Date: Reg. will start in a week
Last date: 5th Jan 2021
Online Exam: 11thβ17th Jan 2021
Batch: 2021 Passout
Eligibilty: B.E/B.Tech/5yrs Integ-M.Tech
Branch: CS/IT/Circuital
CTC: INR 3.50 lpa & 6.75 lpa
Syllabus:
Quant(16)+Log(16)+Ver(16)=16*3=48Mins
Essay(1)+Coding(2)=(20+60)Mins
- via Prepflix
Telegram: @programming_and_coding
#Update 2
38. Pascal triangle 2
1
121
12321
1234321
123454321
#include<stdio.h>
#include<conio.h>
void main()
{
int n, c, k, number = 1, space = n;
clrscr();
printf("Enter number of rows : ");
scanf("%d", &n);
printf("\n");
space = n;
for (c = 1; c <= n; c++)
{
for (k = space; k > 1; k--)
printf(" ");
space--;
for (k = 1; k <= 2 * c - 1; k++)
{
if (k <= c)
{
printf("%d", number);
if (k < c)
number++;
}
else
{
number--;
printf("%d", number);
}
}
number = 1;
printf("\n");
}
getch();
}
@programming_and_coding
1
121
12321
1234321
123454321
#include<stdio.h>
#include<conio.h>
void main()
{
int n, c, k, number = 1, space = n;
clrscr();
printf("Enter number of rows : ");
scanf("%d", &n);
printf("\n");
space = n;
for (c = 1; c <= n; c++)
{
for (k = space; k > 1; k--)
printf(" ");
space--;
for (k = 1; k <= 2 * c - 1; k++)
{
if (k <= c)
{
printf("%d", number);
if (k < c)
number++;
}
else
{
number--;
printf("%d", number);
}
}
number = 1;
printf("\n");
}
getch();
}
@programming_and_coding
39. Number Alphabet Pattern
1
A B
2 3 4
C D E F
5 6 7 8 9
G H I J K L
#include<stdio.h>
#include<conio.h>
void main()
{
int num, r, c;
int i = 1;
char ch = 'A';
clrscr();
printf("Enter the number of rows : ");
scanf("%d", &num);
printf("\n");
for (r = 1; r <= num; r++)
{
for (c = 1; c <= r; c++)
{
if (r % 2 == 0)
{
printf(" %c", ch++);
}
else
{
printf(" %d", i++);
}
}
printf("\n");
}
getch();
}
@programming_and_coding
1
A B
2 3 4
C D E F
5 6 7 8 9
G H I J K L
#include<stdio.h>
#include<conio.h>
void main()
{
int num, r, c;
int i = 1;
char ch = 'A';
clrscr();
printf("Enter the number of rows : ");
scanf("%d", &num);
printf("\n");
for (r = 1; r <= num; r++)
{
for (c = 1; c <= r; c++)
{
if (r % 2 == 0)
{
printf(" %c", ch++);
}
else
{
printf(" %d", i++);
}
}
printf("\n");
}
getch();
}
@programming_and_coding
40. Number Diamond Pattern
1
1 2 3
1 2 3 4 5
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7
1 2 3 4 5
1 2 3
1
#include<stdio.h>
#include<conio.h>
void main()
{
int i, j, k;
clrscr();
for(i=1;i<=5;i++)
{
for(j=i;j<5;j++)
{
printf(" ");
}
for(k=1;k<(i*2);k++)
{
printf("%d",k);
}
printf("\n");
}
for(i=4;i>=1;i--)
{
for(j=5;j>i;j--)
{
printf(" ");
}
for(k=1;k<(i*2);k++)
{
printf("%d",k);
}
printf("\n");
}
getch();
}
@programming_and_coding
1
1 2 3
1 2 3 4 5
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7
1 2 3 4 5
1 2 3
1
#include<stdio.h>
#include<conio.h>
void main()
{
int i, j, k;
clrscr();
for(i=1;i<=5;i++)
{
for(j=i;j<5;j++)
{
printf(" ");
}
for(k=1;k<(i*2);k++)
{
printf("%d",k);
}
printf("\n");
}
for(i=4;i>=1;i--)
{
for(j=5;j>i;j--)
{
printf(" ");
}
for(k=1;k<(i*2);k++)
{
printf("%d",k);
}
printf("\n");
}
getch();
}
@programming_and_coding