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
1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
what does static variable mean?
Why is extern used in c?
Are pointers really faster than arrays?
How do I get an accurate error status return from system on ms-dos?
What are the advantages of the functions?
How does #define work?
What is output redirection?
What is identifiers in c with examples?
Explain argument and its types.
Why is not a pointer null after calling free?
What the advantages of using Unions?
What is s or c?