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

Copy and paste it will run successfully..
#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 ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is variable declaration and definition in c?

497


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

669


What are keywords in c with examples?

600


using only #include and #include Write a program in C that will read an input from the user and print it back to the user if it is a palindrome. The string ends when it encounters a whitespace. The input string is at most 30 characters. Assume the string has no spaces and distinguish between and lowercase. So madam is a palindrome, but MadAm is not a palindrome. Use scanf and %s to read the string. Sample Test: Enter a string: madam madam is a palindrome. Enter a string: 09023 09023 is not a palindrome.

1307


The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration

625






string reverse using recursion

1805


What is exit() function?

559


What is pointer and structure in c?

565


`write a program to display the recomended action depends on a color of trafic light using nested if statments

1629


How can I delete a file?

626


Calculate 1*2*3*____*n using recursive function??

1511


Who is the main contributor in designing the c language after dennis ritchie?

544


Explain setjmp()?

651


Can a local variable be volatile in c?

573


Why c is known as a mother language?

636