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
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples
Is c high or low level?
What does a function declared as pascal do differently?
How do you declare a variable that will hold string values?
Sir i need notes for structure,functions,pointers in c language can you help me please
What is the difference between if else and switchstatement
Why is c called c?
Explain bit masking in c?
What are the types of functions in c?
What are variables c?
What is operator precedence?
By using C language input a date into it and if it is right?
In c programming language, how many parameters can be passed to a function ?
write a program for the normal snake games find in most of the mobiles.