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?
how to make a scientific calculater ?
What is chain pointer in c?
How do you list a file’s date and time?
Can a variable be both const and volatile?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
what are non standard function in c
Write a program to print fibonacci series using recursion?
How many levels of pointers have?
Can we change the value of #define in c?
What is the difference between new and malloc functions?
What does s c mean in text?
write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a
What are categories used for in c?
int i=10; printf("%d %d %d", i, i=20, i);