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 |
What is a stream?
What is the difference between %d and %*d in C
2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier.  Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed.  When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed.  Sequence of take-off is the sequence of addition to the waitlist
1.Why do you call C is middle level language? 2.Why do you call C is userfriendly language.
In a byte, what is the maximum decimal number that you can accommodate?
Is it fine to write void main () or main () in c?
What is static memory allocation?
To what value do nonglobal variables default? 1) auto 2) register 3) static
How do you define CONSTANT in C?
What is meant by initialization and how we initialize a variable?
main() { int a=4,b=2; a=b<<a + b>>2; printf("%d", a); }
11 Answers HCL, Vector, Vector India, Vector Solutions, Wipro,
A program to write a number of letters and numbers, such as counting and display