Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



write a program to display the numbers in the following 4 4 3 ..

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

Post New Answer

More C Interview Questions

The differences between Windows XP and Windows Visa

8 Answers   HCL,


biggest of two no's with out using if condition statement

5 Answers  


What is a segmentation fault?

2 Answers  


what is the associativity of bitwise OR operator?

1 Answers  


What are the characteristics of arrays in c?

0 Answers  


What is the difference between typedef and #define?

0 Answers  


What is the use of keyword VOLATILE in C?

1 Answers  


Write a c program to print the even numbers followed by odd numbers in an array without using additional array

1 Answers   Tech Mahindra,


What is structure packing in c?

0 Answers  


Why is it usually a bad idea to use gets()? Suggest a workaround.

1 Answers  


What is the difference between malloc() and calloc() function in c language?

0 Answers  


How do we declare variables in c?

0 Answers  


Categories