Write a program in c to print
1
121
12321
1234321
123454321
Answer Posted / sahil and dipanshu
#include<stdio.h>
#include<iostream.h>
int main()
{
int i,j,k,num;
num=5;
for(i=1;i<=num;i++)
{
for(j=1;j<num-i;j++)
{
cout<<" ";
}
for(k=1;k<=i;k++)
{
cout<<k;
}
for(k=i;k>1;k--)
{
cout<<k-1;
}
cout<<endl;
}
return 0;
}
Is This Answer Correct ? | 21 Yes | 8 No |
Post New Answer View All Answers
What is pivot in c?
What is break in c?
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
What are lookup tables in c?
Explain the process of converting a Tree into a Binary Tree.
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
What is "Hungarian Notation"?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
What is property type c?
What is pointers in c?
What is the size of enum in bytes?
Can you please explain the difference between exit() and _exit() function?
What is the use of sizeof?
Is null always defined as 0(zero)?
Describe static function with its usage?