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
What is the difference between int main and void main in c?
Function calling procedures? and their differences? Why should one go for Call by Reference?
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
Explain what is operator promotion?
Explain what is the heap?
How to get string length of given string in c?
What are pointers?
What are the different types of endless loops?
Why c is procedure oriented?
formula to convert 2500mmh2o into m3/hr
What is typeof in c?
What is the purpose of the statement: strcat (S2, S1)?
How is actual parameter different from the formal parameter?
What is the Purpose of 'extern' keyword in a function declaration?
What are preprocessor directives in c?