Write a program in c to print
1
121
12321
1234321
123454321
Answer Posted / arun c s
#include <stdio.h>
main()
{
int i, j, k, space, n=9;
for (i=1; i<=n; i++)
{
for (j=1; j<=n-i; j++)
putchar(' ');
for (j=1,k=2*i-1; j<=2*i-1; j++,k--)
{
if (j <= k)
printf("%d", j);
else
printf("%d", k);
}
putchar('
');
}
getch();
}
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.
What does node * mean?
using for loop sum 2 number of any 4 digit number in c language
What is the maximum length of an identifier?
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above
Do you have any idea about the use of "auto" keyword?
What is bash c?
Under what circumstances does a name clash occur?
write a program in c language to print your bio-data on the screen by using functions.
struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer
What are the features of the c language?
write a program fibonacci series and palindrome program in c
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
Where static variables are stored in c?