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
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
What is #ifdef ? What is its application?
How can you check to see whether a symbol is defined?
What are the functions to open and close file in c language?
What does sizeof function do?
Explain union. What are its advantages?
Explain what is the difference between a string and an array?
What is the use of getchar() function?
what is ur strangth & weekness
using for loop sum 2 number of any 4 digit number in c language
What is #line?
What is data structure in c programming?
How old is c programming language?
What is void c?
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above