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
I need a sort of an approximate strcmp routine?
write a c program to find the sum of five entered numbers using an array named number
What is the maximum length of an identifier?
How can I trap or ignore keyboard interrupts like control-c?
In a switch statement, explain what will happen if a break statement is omitted?
Why do we use stdio h and conio h?
What is the explanation for the dangling pointer in c?
What is NULL pointer?
Whats s or c mean?
What does malloc () calloc () realloc () free () do?
What is equivalent to ++i+++j?
Explain what header files do I need in order to define the standard library functions I use?
Is register a keyword in c?
Describe how arrays can be passed to a user defined function
What are the rules for identifiers in c?