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
Between macros and functions,which is better to use and why?
Explain what will the preprocessor do for a program?
What will be the outcome of the following conditional statement if the value of variable s is 10?
What is a pointer value and address in c?
In C programming, what command or code can be used to determine if a number of odd or even?
What is %lu in c?
What is indirection? How many levels of pointers can you have?
What are different types of pointers?
#include
What is c system32 taskhostw exe?
Should a function contain a return statement if it does not return a value?
Why can’t constant values be used to define an array’s initial size?
How do you list files in a directory?
Describe explain how arrays can be passed to a user defined function
Differentiate between static and dynamic modeling.