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 the explanation for the dangling pointer in c?
Explain what does the function toupper() do?
How can I sort a linked list?
How main function is called in c?
What is call by reference in functions?
How do you determine a file’s attributes?
What is output redirection?
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
What is #define in c?
What is the importance of c in your views?
What is the difference between array and pointer?
What is include directive in c?
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
What do the functions atoi(), itoa() and gcvt() do?
code for find determinent of amatrix