Write a program in c to print
1
121
12321
1234321
123454321
Answer Posted / roshan patil
#include<iostream.h>
#include<conio.h>
void main()
{
int i,j,k,num;
cout<<num;
for(i=1;i<=num;i++)
{
for(j=1;j<num-1;j++)
{
cout<<" ";
}
for(k=1;k<i;k++)
{
cout<<k;
}
for(k=i;k>=1;k--)
{
cout<<k;
}
}
}
| Is This Answer Correct ? | 12 Yes | 14 No |
Post New Answer View All Answers
What are the rules for identifiers in c?
What is difference between %d and %i in c?
Discuss the function of conditional operator, size of operator and comma operator with examples.
What is chain pointer in c?
What is indirection?
What is scanf () in c?
Explain the array representation of a binary tree in C.
What is difference between main and void main?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
What is the significance of an algorithm to C programming?
What is difference between far and near pointers?
Explain how do you view the path?
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
Explain two-dimensional array.
Stimulate calculator using Switch-case-default statement for two numbers