Write a program in c to print
1
121
12321
1234321
123454321
Answer Posted / ayas kumar das
#include"stdio.h"
int main()
{
int i,j,n;
printf("enter the number :");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
if(i>1)
{
for(j=i;j>1;)
{
printf("%d",j-1);
j=j-1;
}
}
printf("\n");
}
return 0;
}
| Is This Answer Correct ? | 12 Yes | 20 No |
Post New Answer View All Answers
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
What is 2c dna?
What is c variable?
Is c object oriented?
What is the use of function in c?
Explain what is the use of a semicolon (;) at the end of every program statement?
What are header files why are they important?
Explain how do you list files in a directory?
What is a pointer in c plus plus?
Explain what is output redirection?
What is meant by inheritance?
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
Where are some collections of useful code fragments and examples?
How do I copy files?
Tell me is null always defined as 0(zero)?