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
When c language was developed?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
How can I do peek and poke in c?
What does stand for?
Is c dynamically typed?
Are bit fields portable?
How would you rename a function in C?
Differentiate between #include<...> and #include '...'
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
Explain how can you tell whether a program was compiled using c versus c++?
Explain do array subscripts always start with zero?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
write a program fibonacci series and palindrome program in c
Is Exception handling possible in c language?
Which driver is a pure java driver