Write a program in c to print
1
121
12321
1234321
123454321
Answer Posted / sabby
#include<stdio.h>
main()
{
int i,j,s,n;
printf("Enter the number of rows:");
scanf("%d\n",&n);
for(i=1;i<=n;i++)
{
for(s=1;s<=n-i;s++)
printf(" ");
for(j=1;j<=i;j++)
printf("%d",j);
j=j-2;
for(;j>=1;j--)
{
printf("%d",j);
}
printf("\n");
}
}
Is This Answer Correct ? | 16 Yes | 7 No |
Post New Answer View All Answers
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
pierrot's divisor program using c or c++ code
What is the size of enum in bytes?
Was 2000 a leap year?
Why c is faster than c++?
What is structure padding in c?
What is the process of writing the null pointer?
write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1
What do you mean by command line argument?
What is volatile keyword in c?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
What is a far pointer in c?
Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?
What is struct node in c?
What is the difference between volatile and const volatile?