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
Is main a keyword in c?
Differentiate between #include<...> and #include '...'
Explain About fork()?
What is hungarian notation? Is it worthwhile?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
Explain which function in c can be used to append a string to another string?
I need previous papers of CSC.......plz help out by posting them.......
What is the role of && operator in a program code?
write a c program in such a way that if we enter the today date the output should be next day's date.
Write a program to check whether a number is prime or not using c?
Differentiate between ordinary variable and pointer in c.
Explain the difference between strcpy() and memcpy() function?
What is the use of getch ()?
What is this infamous null pointer, anyway?
What does the function toupper() do?