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


Please Help Members By Posting Answers For Below Questions

Is there a way to jump out of a function or functions?

638


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

1848


What is meant by recursion?

636


What is the difference between c &c++?

650


What are the differences between new and malloc in C?

612






What is scope of variable in c?

573


List the difference between a While & Do While loops?

641


How are Structure passing and returning implemented by the complier?

719


Which is the memory area not included in C program? give the reason

1510


Explain what is wrong with this program statement?

626


Can a pointer be volatile in c?

539


If the size of int data type is two bytes, what is the range of signed int data type?

596


What is c language in simple words?

598


What is the difference between ā€˜gā€™ and ā€œgā€ in C?

2619


Write a C program in Fibonacci series.

640