write a program for
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 1
2 2 2 2 2 2
3 3 3 3
4 4
Answer / vidyullatha
#include<stdio.h>
main()
{
int i=0,k=0,l=0;
int cnt=1;
int space=7;
for (i=4;i>0;i--)
{
for(l=1;l<=cnt;l++)
{
printf("%d ",i);
}
for(k=0;k<space;k++)
{
printf(" ");
}
for(l=1;l<=cnt;l++)
{
printf("%d ",i);
}
cnt++;
space=space-2;
printf("\n");
}
for(i=0;i<9;i++)
{
printf("0 ");
}
printf("\n");
cnt=4;
space=1;
for(i=1;i<=4;i++)
{
for(l=1;l<=cnt;l++)
{
printf("%d ",i);
}
for(k=0;k<space;k++)
{
printf(" ");
}
for(l=1;l<=cnt;l++)
{
printf("%d ",i);
}
cnt--;
space=space+2;
printf("\n");
}
}
| Is This Answer Correct ? | 5 Yes | 1 No |
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
Please list all the unary and binary operators in C.
How many types of errors are there in c language? Explain
What is a volatile keyword in c?
if the total selling price of 15 items and the total profit earned on them is input through the keyboard, write a program to find the cost price of one of the item
Why do we use null pointer?
main() { int i=400,j=300; printf("%d..%d"); }
dennis ritchie invented C language in AT&T bell laboratory what is the extension of AT&T?
What is the best way to comment out a section of code that contains comments?
what is op? for(c=0;c=1000;c++) printf("%c",c);
What is the process to create increment and decrement stamen in c?
How can I implement sets or arrays of bits?