write a program to display the numbers in the following
format
4 4
3 3 3 3
2 2 2 2 2 2
1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1
2 2 2 2 2
3 3 3
4
Answer Posted / bharath_471
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,l,n;
clrscr();
printf("enter the number");
scanf("%d",&n);
for(j=n,l=1;(j>0 && l<=n);j--,l++)
{
for(k=1;k<=2*l;k++)
printf("%d",j);
printf("
");
}
for(j=0,l=n;(j<=n && l>=0) ;j++,l--)
{
for(k=1;k<=2*l+1;k++)
printf("%d",j);
printf("
");
}
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How can you return multiple values from a function?
What does node * mean?
Is main a keyword in c?
Is c dynamically typed?
What are the general description for loop statement and available loop types in c?
What are the features of c language?
Explain how do you view the path?
What do you mean by scope of a variable in c?
How do you initialize pointer variables?
How can I write a function that takes a format string and a variable number of arguments?
write a program in c language to print your bio-data on the screen by using functions.
Can you please explain the scope of static variables?
What is a good way to implement complex numbers in c?
What is assignment operator?
What is the difference between %d and %i?