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 / jankipatel
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,l,p;
clrscr();
// printf("enter the value\n");
// scanf("%d",&l);
for(i=4;i>=0;i--)
{
for(j=4;j>=i;j--)
{
// textcolor(0-i);
printf("%d ",i);
}
for(k=0;k<=i-1;k++)
{
printf(" ");
}
for(k=0;k<=i-1;k++)
{
printf(" ");
}
for(j=4;j>=i;j--)
{
// textcolor(0-i);
printf(" %d",i);
}
printf("\n");
}
for(i=1;i<=4;i++)
{
for(j=1;j<=i;j++)
{
printf(" ");
}
for(k=4;k>=i;k--)
{
printf("%d ",i);
}
for(k=4;k>=i;k--)
{
printf(" %d",i);
}
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the newline escape sequence?
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm
How can you increase the size of a dynamically allocated array?
Explain what is the concatenation operator?
How can I determine whether a machines byte order is big-endian or little-endian?
Explain what is a 'locale'?
What is the condition that is applied with ?: Operator?
List some of the dynamic data structures in C?
How to implement a packet in C
Explain Function Pointer?
Are bit fields portable?
How can I send mail from within a c program?
Explain how can you tell whether two strings are the same?
What is c value paradox explain?
why do some people write if(0 == x) instead of if(x == 0)?