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
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
What is the importance of c in your views?
What is masking?
Hi can anyone tell what is a start up code?
will u please send me the placement papers to my mail???????????????????
What is the use of a conditional inclusion statement in C?
How to get string length of given string in c?
Explain the bubble sort algorithm.
What are pointers?
What is hashing in c language?
Define Spanning-Tree Protocol (STP)
Tell us two differences between new () and malloc ()?
What are the __date__ and __time__ preprocessor commands?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
Why c language is called c?