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

What is the explanation for the dangling pointer in c?

1062


Explain what does the function toupper() do?

1007


How can I sort a linked list?

977


How main function is called in c?

1076


What is call by reference in functions?

1327


How do you determine a file’s attributes?

1019


What is output redirection?

1171


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

1046


What is #define in c?

995


What is the importance of c in your views?

1097


What is the difference between array and pointer?

969


What is include directive in c?

1096


A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

2080


What do the functions atoi(), itoa() and gcvt() do?

1140


code for find determinent of amatrix

1920