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
Differentiate between full, complete & perfect binary trees.
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
Can I initialize unions?
Is null always equal to 0(zero)?
What is && in c programming?
What is far pointer in c?
What is a pointer in c plus plus?
What is %g in c?
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
What is difference between structure and union in c?
What is use of integral promotions in c?
What is a null string in c?
Explain what is gets() function?
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
What is the difference between test design and test case design?