Write a program in c to print
1
121
12321
1234321
123454321
Answer Posted / durai
int a, b;
for( a=1;i<=5;a++)
{
for(b=1;b<=(2*a-1);b++)
{ if(b<=a)
printf b;
else
printf(2*a-b);
}
printf
;
}
| Is This Answer Correct ? | 0 Yes | 5 No |
Post New Answer View All Answers
What are integer variable, floating-point variable and character variable?
Difference between pass by reference and pass by value?
What is wrong with this code?
Write a program of prime number using recursion.
How does free() know explain how much memory to release?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
What does int main () mean?
Define VARIABLE?
What is pass by reference in c?
Explain how can I remove the trailing spaces from a string?
What are c preprocessors?
what is the difference between 123 and 0123 in c?
How can I trap or ignore keyboard interrupts like control-c?
Explain the advantages and disadvantages of macros.
What are the difference between a free-standing and a hosted environment?