write a program to display the numbers in the following
4 4
3 3
2 2
1 1
0
1 1
2 2
3 3
4 4
Answer / vidyullatha
#include<stdio.h>
main()
{
int i,j,k,l;
int space=7;
for(i=4;i>=0;i--)
{
for(j=4;j>i;j--)
{
printf(" ");
}
printf("%d ",i);
for(j=0;j<space;j++)
{
printf(" ");
}
if(space>0)
printf("%d ",i);
space = space-2;
printf("\n");
}
space = 1;
for(i=1;i<=4;i++)
{
for(j=4;j>i;j--)
{
printf(" ");
}
printf("%d ",i);
for(j=0;j<space;j++)
{
printf(" ");
}
printf("%d ",i);
space = space+2;
printf("\n");
}
}
| Is This Answer Correct ? | 6 Yes | 0 No |
Explain a pre-processor and its advantages.
what will be the output of "printf("%d%d",scanf("%d% d",&a,&b))".provide an explation regarding the question
write a c program to print "Welcome" without using semicolon in the whole program ??
Write a factorial program using C.
what is the use of operator ^ in C ? and how it works?
Write a program in c to replace any vowel in a string with z?
What is the Purpose of 'extern' keyword in a function declaration?
C program code int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the call zap(6) gives the values of zap [a] 8 [b] 9 [c] 6 [d] 12 [e] 15
How many levels deep can include files be nested?
can v write main() { main(); } Is it true?
write a C code To reverse a linked list
Do you know the use of 'auto' keyword?