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
What is wrong in this statement? scanf(ā%dā,whatnumber);
What is methods in c?
What is character constants?
What is the maximum no. of arguments that can be given in a command line in C.?
What are the application of void data type in c?
What is the function of volatile in c language?
How do I swap bytes?
explain how do you use macro?
State two uses of pointers in C?
Calculate 1*2*3*____*n using recursive function??
Explain setjmp()?
Explain what is the difference between text files and binary files?
What are the modifiers available in c programming language?
writ a program to compare using strcmp VIVA and viva with its output.
What is the meaning of ?