SIR PLS TELL ME THE CODE IN C LANGUAGE TO PRINT THE
FOLLOWING SERIES
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 2 1
1 2 1
1
Answer Posted / sakthivel
/*
Written By : Sakthivel
Tested By : Rajavelraj
*/
#include<stdio.h>
#include<conio.h>
public void main()
{
int i,j,k,l,a=1;
for(i=1;i<=4;i++)
{
for(j=4;j>i;j--)
{
printf(" ");
}
for(k=1;k<=i;k++)
{
printf("%d",k);
}
for(l=i;l>1;l--)
{
printf("%d",l-1);
}
printf("\n");
}
for(i=4;i>1;i--)
{
for(j=1;j<=a;j++)
{
printf(" ");
}
for(k=1;k<i;k++)
{
printf("%d",k);
}
for(l=k-1;i>1;l--)
{
printf("%d",l-1);
}
a=a+1;
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
How do I read the arrow keys? What about function keys?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
Explain zero based addressing.
What does 3 periods mean in texting?
How do we open a binary file in Read/Write mode in C?
What is the purpose of scanf() and printf() functions?
Who is the founder of c language?
Explain how can a program be made to print the line number where an error occurs?
What is %g in c?
simple program of graphics and their output display
Is c is a procedural language?
How is a structure member accessed?
Explain what does it mean when a pointer is used in an if statement?
What is %lu in c?
What do you understand by normalization of pointers?