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
Write a program to generate random numbers in c?
What is the use of static variable in c?
What is hash table in c?
What is the use of linkage in c language?
Do you know the use of fflush() function?
What does 1f stand for?
How can I call a function with an argument list built up at run time?
What is s in c?
Why does everyone say not to use gets?
Explain the difference between malloc() and calloc() in c?
Are pointers really faster than arrays?
how do you programme Carrier Sense Multiple Access
What is type qualifiers?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result