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
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
What are the types of c language?
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
What are the disadvantages of a shell structure?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What is file in c preprocessor?
Define macros.
Can you please explain the difference between exit() and _exit() function?
What is a null string in c?
What is a class c rental property?
How can I do peek and poke in c?
How do you use a 'Local Block'?
Define C in your own Language.
Is fortran still used today?
What would be an example of a structure analogous to structure c?