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 ? | 1 Yes | 0 No |
Post New Answer View All Answers
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
Explain #pragma statements.
Explain what is the stack?
How do I determine whether a character is numeric, alphabetic, and so on?
What are the keywords in c?
What is the use of typedef in structure in c?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
What is the purpose of macro in C language?
Explain why can’t constant values be used to define an array’s initial size?
What is strcmp in c?
explain what is fifo?
What is advantage of pointer in c?
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above