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 wrong in this statement? scanf(ā€œ%dā€,whatnumber);

1246


What is methods in c?

1104


What is character constants?

1190


What is the maximum no. of arguments that can be given in a command line in C.?

1157


What are the application of void data type in c?

1191


What is the function of volatile in c language?

1137


How do I swap bytes?

1083


explain how do you use macro?

1166


State two uses of pointers in C?

1066


Calculate 1*2*3*____*n using recursive function??

2048


Explain setjmp()?

1079


Explain what is the difference between text files and binary files?

1165


What are the modifiers available in c programming language?

1227


writ a program to compare using strcmp VIVA and viva with its output.

2027


What is the meaning of ?

1042