Write a program for the following series?
1
121
12321
1234321
123454321
12345654321
1234567654321
123456787654321
12345678987654321
1234567890987654321
123456789010987654321
12345678901210987654321
1234567890123210987654321
.........1234321............
..........123454321............
..........12345654321............
7
8
9
0
1
Pls............?
Answer Posted / eranna
#include<stdio.h>
void main()
{
int i,j,n,k;
printf("Enter no.of lines :");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("\t");
for(j=1;j<=n-i;j++)
printf(" ");
for(j=1;j<=i;j++)
printf("%d",j);
for(k=j-2;k>0;k--)
printf("%d",k);
printf("\n");
}
}
| Is This Answer Correct ? | 13 Yes | 1 No |
Post New Answer View All Answers
How to get string length of given string in c?
Explain can static variables be declared in a header file?
What is the difference between pure virtual function and virtual function?
What is the use of parallelize in spark?
What are different types of variables in c?
What is memory leak in c?
What does node * mean?
What is difference between function overloading and operator overloading?
hi send me sample aptitude papers of cts?
What is the c language function prototype?
what are non standard function in c
Explain what is the difference between the expression '++a' and 'a++'?
Explain argument and its types.
What is the deal on sprintf_s return value?
Do pointers need to be initialized?