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
How can I write functions that take a variable number of arguments?
What are identifiers and keywords in c?
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
Explain the difference between strcpy() and memcpy() function?
What are pointers? Why are they used?
Differentiate between full, complete & perfect binary trees.
Is return a keyword in c?
What is a void * in c?
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.?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
When c language was developed?
List some of the static data structures in C?
Explain c preprocessor?
When we use void main and int main?
Explain what is the difference between #include and #include 'file' ?