Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

WRITE A C PROGRAM FOR PRINT "RHOMBUS" STRUCTURE .
Example:
Enter the numbers :3
*
* *
* *
* *
*

Answer Posted / sagarsp2010

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,n;
clrscr();

printf("\nEnter the No. :");
scanf("%d",&n);

for(i=1;i<=n+(n-1);i++)
{
for(j=1;j<=n+(n-1);j++)
{
if(i+j==(n+1) || i+j==(n+n+n-1) || i-j==(n-
1) || i-j==-(n-1))
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}

Is This Answer Correct ?    14 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is main a keyword in c?

1138


Differentiate between #include<...> and #include '...'

1066


Explain About fork()?

1124


What is hungarian notation? Is it worthwhile?

1231


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1287


Explain which function in c can be used to append a string to another string?

1095


I need previous papers of CSC.......plz help out by posting them.......

2298


What is the role of && operator in a program code?

1080


write a c program in such a way that if we enter the today date the output should be next day's date.

2200


Write a program to check whether a number is prime or not using c?

1064


Differentiate between ordinary variable and pointer in c.

1190


Explain the difference between strcpy() and memcpy() function?

1024


What is the use of getch ()?

1077


What is this infamous null pointer, anyway?

1065


What does the function toupper() do?

1138