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 way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
What is data structure in c language?
What are reserved words?
What are the advantages of external class?
How to establish connection with oracle database software from c language?
Is it possible to pass an entire structure to functions?
What is && in c programming?
How can I implement sets or arrays of bits?
What is an example of structure?
What are conditional operators in C?
Explain how can you tell whether a program was compiled using c versus c++?
difference between native and cross compilers
What is gets() function?
Describe the order of precedence with regards to operators in C.
Why do some versions of toupper act strangely if given an upper-case letter?