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
Is there a way to jump out of a function or functions?
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
What is meant by recursion?
What is the difference between c &c++?
What are the differences between new and malloc in C?
What is scope of variable in c?
List the difference between a While & Do While loops?
How are Structure passing and returning implemented by the complier?
Which is the memory area not included in C program? give the reason
Explain what is wrong with this program statement?
Can a pointer be volatile in c?
If the size of int data type is two bytes, what is the range of signed int data type?
What is c language in simple words?
What is the difference between āgā and āgā in C?
Write a C program in Fibonacci series.