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
What is meant by realloc()?
What is variable declaration and definition in c?
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
What does stand for?
What is a example of a variable?
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
What does c mean?
What is a spanning Tree?
What is the mean of function?
Is fortran still used in 2018?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is wrong in this statement? scanf(ā%dā,whatnumber);
What is uint8 in c?
How to write c functions that modify head pointer of a linked list?