Write a program in c to print
1
121
12321
1234321
123454321
Answer Posted / sabby
#include<stdio.h>
main()
{
int i,j,s,n;
printf("Enter the number of rows:");
scanf("%d\n",&n);
for(i=1;i<=n;i++)
{
for(s=1;s<=n-i;s++)
printf(" ");
for(j=1;j<=i;j++)
printf("%d",j);
j=j-2;
for(;j>=1;j--)
{
printf("%d",j);
}
printf("\n");
}
}
| Is This Answer Correct ? | 16 Yes | 7 No |
Post New Answer View All Answers
Why we use void main in c?
Explain b+ tree?
What is main return c?
Why do we use pointer to pointer in c?
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record
Explain how can I prevent another program from modifying part of a file that I am modifying?
How is null defined in c?
Explain the use of #pragma exit?
What is the best way to store flag values in a program?
What are different storage class specifiers in c?
What is wild pointer in c?
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
What are valid signatures for the Main function?
can anyone suggest some site name..where i can get some good data structure puzzles???
What is the total generic pointer type?