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 |
How can you increase the size of a dynamically allocated array?
if function is declared as static in one source file, if I would like to use the same function in some other source file...is it possible....how ?
though sbi was nationalized why its not comes under nationalized banks and its comes under publicsector banks
3 Answers State Bank Of India SBI,
What are the phases in s/w developed life cycle? wat is the diff b/w stack & queue...where do we use stack
what is the difference between declaration and definition of a variable or function ?
c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above
what is the output of the following program? #include<stdio.h> void main() { float x=1.1; while(x==1.1) { printf("\n%f",x); x=x-0.1; } }
a simple program in c language
What is the difference between arrays and pointers?
Can we replace the struct function in tree syntax with a union?
Find greatest number out of 10 number without using loop.
What is a sequential access file?