Write a program to give following output.....
*********
**** ****
*** ***
** **
* *
** **
*** ***
**** ****
*********
Answer Posted / monty
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
for(a=1;a<10;a++)
{
for(b=1;b<10;b++)
{
if((a==2 && b==5) ||
(a==3 && (b==4 || b==5 || b==6) )
||
(a==4 && (b>=3 && b<=7) )
||
(a==5 && (b>=2 && b<=8) )
||
(a==6 && (b>=3 && b<=7) )
||
(a==7 && (b==4 || b==5 || b==6) )
||
(a==8 && b==5))
printf("-");
else
printf("*");
}
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Can we increase size of array in c?
What is the heap in c?
Is calloc better than malloc?
my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?
When is a null pointer used?
How does placing some code lines between the comment symbol help in debugging the code?
What are the loops in c?
Do pointers take up memory?
How can you call a function, given its name as a string?
How to compare array with pointer in c?
write a program to display all prime numbers
How pointer is different from array?
What is integer constants?
Explain how does flowchart help in writing a program?
How do I get an accurate error status return from system on ms-dos?