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 |
The differences between Windows XP and Windows Visa
biggest of two no's with out using if condition statement
What is a segmentation fault?
what is the associativity of bitwise OR operator?
What are the characteristics of arrays in c?
What is the difference between typedef and #define?
What is the use of keyword VOLATILE in C?
Write a c program to print the even numbers followed by odd numbers in an array without using additional array
What is structure packing in c?
Why is it usually a bad idea to use gets()? Suggest a workaround.
What is the difference between malloc() and calloc() function in c language?
How do we declare variables in c?