060
Write a C Program to print the Following Pattern?
4
4 3
4 3 2
4 3 2 1
4 3 2 1 0
4 3 2 1
4 3 2
4 3
4
#include<stdio.h>
void main()
{
int size = 4;
int i, j, k;
for (i = size; i >= -size; i--)
{
for (j = 1; j <= abs (i); j++)
printf (" ");
for (k = size; k >= abs (i); k--)
printf ("%d ", k);
printf ("\n");
}
}
061
Write a C Program to print the Following Pattern?
4
3 4
2 3 4
1 2 3 4
0 1 2 3 4
1 2 3 4
2 3 4
3 4
4
#include<stdio.h>
void main ()
{
int size = 4;
int i, j, k;
for (i = size; i >= -size; i--)
{
for (j = 1; j <= abs (i); j++)
printf (" ");
for (k = abs (i); k <= size; k++)
printf ("%d ", k);
printf ("\n");
}
}
062
Write a C Program to print the Following Pattern?
D
C D
B C D
A B C D
B C D
C D
D
#include<stdio.h>
void main ()
{
int size = 3;
int i, j, k;
for (i = size; i >= -size; i--)
{
for (j = 1; j <= abs (i); j++)
printf (" ");
for (k = abs (i); k <= size; k++)
printf ("%c ", k + 65);
printf ("\n");
}
}
063
Write a C Program to print the Following Pattern?
D
D C
D C B
D C B A
D C B
D C
D
#include<stdio.h>
void main ()
{
int size = 3;
int i, j, k;
for (i = size; i >= -size; i--)
{
for (j = 1; j <= abs (i); j++)
printf (" ");
for (k = size; k >= abs (i); k--)
printf ("%c ", k + 65);
printf ("\n");
}
}
064
Write a C Program to print the Following Pattern?
*
* *
* * *
* * * *
* * * * *
#include<stdio.h>
void main ()
{
int i, j, k;
int p_height = 5;
for (i = 1; i <= p_height; i++)
{
for (k = p_height; k >= i; k--)
printf (" ");
for (j = 1; j <= i; j++)
printf ("* ");
printf ("\n");
}
}
//-- Another Logic using if-else--//
#include<stdio.h>
void main ()
{
int n = 5;
int i, j, k;
for (i = 1; i <= n; i++)
{
for (j = n; j >= 1; j--)
{
if (i >= j)
printf ("* ");
else
printf (" ");
}
printf ("\n");
}
}
065
Write a C Program to print the Following Pattern?
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
#include<stdio.h>
void main ()
{
int i, j, k;
for (i = 1; i <= 5; i++)
{
for (k = 4; k >= i; k--)
printf (" ");
for (j = 1; j <= i; j++)
printf ("%d ", i);
printf ("\n");
}
}
066
Write a C Program to print the Following Pattern?
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
#include<stdio.h>
void main ()
{
int i, j, k;
for (i = 1; i <= 5; i++)
{
for (k = 4; k >= i; k--)
printf (" ");
for (j = 1; j <= i; j++)
printf ("%d ", j);
printf ("\n");
}
}
067
Write a C Program to print the Following Pattern?
A
B B
C C C
D D D D
E E E E E
#include<stdio.h>
void main ()
{
int i, j, k;
for (i = 0; i < 5; i++)
{
for (k = 4; k >= i; k--)
printf (" ");
for (j = 0; j <= i; j++)
printf ("%c ", i + 65);
printf ("\n");
}
}
068
Write a C Program to print the Following Pattern?
A
A B
A B C
A B C D
A B C D E
#include<stdio.h>
void main ()
{
int i, j, k;
for (i = 0; i < 5; i++)
{
for (k = 4; k >= i; k--)
printf (" ");
for (j = 0; j <= i; j++)
printf ("%c ", j + 65);
printf ("\n");
}
}
069
Write a C Program to print the Following Pattern?
* * * * *
* * * *
* * *
* *
*
#include<stdio.h>
void main ()
{
int i, j, k;
int p_height = 5;
for (i = p_height; i >= 1; i--)
{
for (k = p_height - 1; k >= i; k--)
printf (" ");
for (j = i; j >= 1; j--)
printf ("* ");
printf ("\n");
}
}
//-- Another Logic using if-else--//
#include<stdio.h>
void main ()
{
int n = 5; //size
int i, j;
for (i = n; i >= 1; i--)
{
for (j = n ; j >= 1; j--)
{
if (i >= j)
printf ("* ");
else
printf (" ");
}
printf ("\n");
}
}
.png)