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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the main difference between calloc () and malloc ()?

1163


A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?

2054


Is main an identifier in c?

1148


Explain how do you use a pointer to a function?

1116


WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..

2090


What is the equivalent code of the following statement in WHILE LOOP format?

1307


Explain what does the function toupper() do?

1083


How do shell structures work?

1123


Which is better oop or procedural?

1080


i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....

1982


What is c language in simple words?

1069


What is conio h in c?

1049


What is function in c with example?

1167


write a proram to reverse the string using switch case?

2954


What is the difference between abs() and fabs() functions?

1135