Write a program in c to print
1
121
12321
1234321
123454321
Answer Posted / vivek raghuwanshi
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,num;
cout<<num;
for(i=1;i<=num;i++)
{
for(j=1;j<i-1;j++)
{
cout<<" ";
}
for(k=1;k<i;k++)
{
cout<<k;
}
for(k=i;k>=1;k--)
{
cout<<k;
}
}
}
| Is This Answer Correct ? | 13 Yes | 31 No |
Post New Answer View All Answers
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
In c language can we compile a program without main() function?
write a program to print data of 5 five students with structures?
What is a substring in c?
What is meant by preprocessor in c?
What is the difference between typedef struct and struct?
What do you understand by normalization of pointers?
Who is the founder of c language?
Is c high or low level?
What is const volatile variable in c?
What does a function declared as pascal do differently?
Is there any possibility to create customized header file with c programming language?
What does printf does?
Is null valid for pointers to functions?
What is d'n in c?