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
What is c language in simple words?
What is exit() function?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"
Explain what does it mean when a pointer is used in an if statement?
What is bss in c?
What is the Purpose of 'extern' keyword in a function declaration?
what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555
What is the basic structure of c?
int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above
Why c is called a mid level programming language?
write a program to display all prime numbers
explain what are actual arguments?
Is c still used?
What does void main () mean?