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
Write a program to know whether the input number is an armstrong number.
What is dynamic variable in c?
What are the disadvantages of external storage class?
Why is extern used in c?
write a program for the normal snake games find in most of the mobiles.
Write a program to check whether a number is prime or not using c?
How can I open a file so that other programs can update it at the same time?
What is a list in c?
Explain what is the stack?
how do you execute a c program in unix.
What is FIFO?
Is the exit() function same as the return statement? Explain.
Explain what are the advantages and disadvantages of a heap?
Explain function?
What is the purpose of 'register' keyword in c language?