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
Is it better to use malloc() or calloc()?
Differentiate between null and void pointers.
Why is structure important for a child?
Can we change the value of static variable in c?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
how to write optimum code to divide a 50 digit number with a 25 digit number??
How can you tell whether a program was compiled using c versus c++?
What is volatile, register definition in C
how to make a scientific calculater ?
Differentiate between full, complete & perfect binary trees.
Write a code to remove duplicates in a string.
Describe the steps to insert data into a singly linked list.
What is the difference between class and object in c?
What does c value mean?
How can you allocate arrays or structures bigger than 64K?