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
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.
Write a program to swap two numbers without using the third variable?
Compare interpreters and compilers.
Why is C language being considered a middle level language?
What is the general form of function in c?
Is file a keyword in c?
how is the examination pattern?
Is struct oop?
What is sizeof array?
What is the use of parallelize in spark?
Explain what is page thrashing?
What is a good way to implement complex numbers in c?
Explain the difference between exit() and _exit() function?
Do you have any idea about the use of "auto" keyword?
Why is c called a structured programming language?