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


Please Help Members By Posting Answers For Below Questions

When c language was developed?

644


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

661


How can I do peek and poke in c?

623


What does stand for?

601


Is c dynamically typed?

671






Are bit fields portable?

681


How would you rename a function in C?

625


Differentiate between #include<...> and #include '...'

621


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

1892


Explain how can you tell whether a program was compiled using c versus c++?

582


Explain do array subscripts always start with zero?

763


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

1909


write a program fibonacci series and palindrome program in c

633


Is Exception handling possible in c language?

1588


Which driver is a pure java driver

996