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 are external variables in c?
What is c standard library?
When do we get logical errors?
Can you think of a logic behind the game minesweeper.
How to define structures? ·
how to write a c program to print list of fruits in alpabetical order?
What is sizeof c?
Explain how can you be sure that a program follows the ansi c standard?
Can we declare a function inside a function in c?
Why does not c have an exponentiation operator?
Explain why can’t constant values be used to define an array’s initial size?
What is a pointer on a pointer in c programming language?
Is anything faster than c?
What is static function in c?
What does calloc stand for?