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...

i want the code for printing the output as follows

4 4
3 3
2 2
1 1
0
1 1
2 2
3 3
4 4

Answer Posted / shafi dayatar

#include<stdio.h>

int main(){

int i=0,j=0;
for(i=0;i<9;i++){
for(j=0;j<9;j++){

if( i==j || i+j==8)
if(i<=4)
printf("%d",4-i);
else
printf("%d",i-4);
else
printf(" ");
}
printf("\n");
}

return 0;

}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to know whether the input number is an armstrong number.

1140


What is dynamic variable in c?

1047


What are the disadvantages of external storage class?

1071


Why is extern used in c?

1102


write a program for the normal snake games find in most of the mobiles.

2269


Write a program to check whether a number is prime or not using c?

1071


How can I open a file so that other programs can update it at the same time?

1200


What is a list in c?

1046


Explain what is the stack?

1117


how do you execute a c program in unix.

1126


What is FIFO?

1749


Is the exit() function same as the return statement? Explain.

1116


Explain what are the advantages and disadvantages of a heap?

1095


Explain function?

1103


What is the purpose of 'register' keyword in c language?

1034