write a pgm to print
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1

Answer Posted / nisrar

void main()
{
int i,j,k,m;
for(i=1;i<=4;i++)
{
for(j=4;j>i;j--)
{
printf(" ");
}
for(k=1;k<=i;k++)
{
printf("%d",k);
}
for(m=i;m>1;m--)
{
printf("%d",m-1);
}
printf("\n");
}
}

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

State the difference between realloc and free.

627


What is a program flowchart and how does it help in writing a program?

658


What is identifier in c?

539


What are the various types of control structures in programming?

625


Does c have circular shift operators?

726






What is "Duff's Device"?

699


What do you mean by a local block?

627


What is the difference between Printf(..) and sprint(...) ?

780


Explain what is the benefit of using #define to declare a constant?

604


Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

1588


What is the difference between the expression “++a” and “a++”?

648


What is dynamic memory allocation?

804


What is the mean of function?

644


What is void main () in c?

722


1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321

3138