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
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
What is the difference between ++a and a++?
Explain what is a pragma?
What are linker error?
If errno contains a nonzero number, is there an error?
Explain how do you use a pointer to a function?
what is the syallabus of computer science students in group- 1?
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
what are bit fields? What is the use of bit fields in a structure declaration?
Explain enumerated types.
What is a file descriptor in c?
What is the best way to comment out a section of code that contains comments?
What is the meaning of 2d in c?
What is typedef struct in c?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.