adspace
WRITE A C PROGRAM FOR PRINT "RHOMBUS" STRUCTURE .
Example:
Enter the numbers :3
*
* *
* *
* *
*
Answer Posted / shakil ahmed
#include<stdio.h>
#include<conio.h>
main()
{
int i, j,s,si,n;
scanf("%d",&n);
s=n-1;
si=1;
for(i=1; i<=n-1; i++)
printf(" ");
printf("*\n");
for(i=1; i<=n-1; i++)
{
for(j=1; j<=s-1; j++)
printf(" ");
s--;
printf("*");
for(j=1; j<=si; j++)
printf(" ");
si+=2;
printf("*\n");
}
s=1;
si-=4;
for(i=1; i<=n-2; i++)
{
for(j=1; j<=s; j++)
printf(" ");
s++;
printf("*");
for(j=1;j<=si;j++)
printf(" ");
si-=2;
printf("*\n");
}
for(i=1; i<=n-1; i++)
printf(" ");
printf("*\n");
}
| Is This Answer Correct ? | 9 Yes | 10 No |
Post New Answer View All Answers
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
write a progrmm in c language take user interface generate table using for loop?
write a c program to find the sum of five entered numbers using an array named number
The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?
will u please send me the placement papers to my mail???????????????????
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
what is ur strangth & weekness
How can I implement sets or arrays of bits?
What are pointers? What are different types of pointers?
i have a written test for microland please give me test pattern
hi send me sample aptitude papers of cts?
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What is dynamic dispatch in c++?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;