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 is difference between structure and union?
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
What are logical errors and how does it differ from syntax errors?
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions
Is sizeof a keyword in c?
Why are algorithms important in c program?
Explain the meaning of keyword 'extern' in a function declaration.
Are the outer parentheses in return statements really optional?
What is gets() function?
Can you please explain the difference between strcpy() and memcpy() function?
What is return type in c?
What is a method in c?
Hi can anyone tell what is a start up code?
What is stack in c?
4. main() { int c=- -2; printf("c=%d",c); }