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
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
What is header file definition?
What are the application of c?
What is the difference between NULL and NUL?
Explain what is a stream?
What are the applications of c language?
What do you mean by c what are the main characteristics of c language?
What is NULL pointer?
int far *near * p; means
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
What are multibyte characters?
Why enum is used in c?
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
what is different between auto and local static? why should we use local static?