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

How can you increase the size of a dynamically allocated array?

0 Answers   TISL,


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 ?

2 Answers   NetApp,


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

6 Answers  


what is the difference between declaration and definition of a variable or function ?

3 Answers  


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

0 Answers  


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; } }

6 Answers  


a simple program in c language

5 Answers   IBM,


What is the difference between arrays and pointers?

0 Answers  


Can we replace the struct function in tree syntax with a union?

0 Answers   Huawei,


Find greatest number out of 10 number without using loop.

5 Answers   TCS,


What is a sequential access file?

0 Answers  


Categories