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

I need a sort of an approximate strcmp routine?

1081


write a c program to find the sum of five entered numbers using an array named number

2209


What is the maximum length of an identifier?

1232


How can I trap or ignore keyboard interrupts like control-c?

1118


In a switch statement, explain what will happen if a break statement is omitted?

1129


Why do we use stdio h and conio h?

1136


What is the explanation for the dangling pointer in c?

1180


What is NULL pointer?

1144


Whats s or c mean?

1087


What does malloc () calloc () realloc () free () do?

1105


What is equivalent to ++i+++j?

1151


Explain what header files do I need in order to define the standard library functions I use?

1229


Is register a keyword in c?

1091


Describe how arrays can be passed to a user defined function

1348


What are the rules for identifiers in c?

1123