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
How can you pass an array to a function by value?
What does s c mean in text?
What is derived datatype in c?
Explain what is dynamic data structure?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
What is the difference between constant pointer and constant variable?
Why is c faster?
How can I do graphics in c?
Write a program to print factorial of given number using recursion?
Once I have used freopen, how can I get the original stdout (or stdin) back?
What does c mean before a date?
Are local variables initialized to zero by default in c?
What is a node in c?
What is linear search?
What does malloc () calloc () realloc () free () do?