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
Function calling procedures? and their differences? Why should one go for Call by Reference?
Explain main function in c?
Can you think of a logic behind the game minesweeper.
what is the syallabus of computer science students in group- 1?
How do you view the path?
What is the explanation for modular programming?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
write a progrmm in c language take user interface generate table using for loop?
Differentiate between null and void pointers.
Write a program to print all permutations of a given string.
What is a structure in c language. how to initialise a structure in c?
List the difference between a While & Do While loops?
What is the difference between scanf and fscanf?
What are dangling pointers in c?
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,