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 / ubaid

Try this program it will show ascending and descending both order. i hope it work correct .. .please try
#include<conio.h>
#include<stdio.h>
void Ubaid(int x)
{
for(int i=x;i>0;i--)
{
printf("\n");
for(int j=1; j<=i; j++)
{
printf("%d",j);
}
for(int u=i-1;u>0;u--)
{
printf("%d",u);
}
}
//start another from here
for(int p=1;p<=x;p++)
{
printf("\n");
for(int e=1;e<p;e++)
{
printf("%d",e);
}
for(int o=e;o>0;o--)
{
printf("%d",o);
}
}

}
void main()
{
clrscr();
printf("the output of function is..");
printf("\n");
printf("\n");
Ubaid(6);
getch();
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I write functions that take a variable number of arguments?

621


What are identifiers and keywords in c?

564


If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402

3245


Explain the difference between strcpy() and memcpy() function?

588


What are pointers? Why are they used?

627






Differentiate between full, complete & perfect binary trees.

667


Is return a keyword in c?

594


What is a void * in c?

589


Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

620


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1252


When c language was developed?

633


List some of the static data structures in C?

757


Explain c preprocessor?

678


When we use void main and int main?

588


Explain what is the difference between #include and #include 'file' ?

579