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
What is the difference between call by value and call by reference in c?
How can I read data from data files with particular formats?
Give differences between - new and malloc() , delete and free() ?
Explain the difference between getch() and getche() in c?
Explain what is the benefit of using #define to declare a constant?
How can I sort more data than will fit in memory?
What is the difference between declaring a variable and defining a variable?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
regarding pointers concept
What is identifier in c?
What is extern variable in c with example?
What are local static variables? How can you use them?
What does c mean before a date?
Write a program which returns the first non repetitive character in the string?
What does %p mean?