Page Contents
Interview Content
- C Programming Coding Questions
- C Pattern Programming Questions
- C Programming Interview Questions
- Java Programming Coding Questions
- Java Pattern Programming Questions
- Java Programming Interview Questions
- Python Programming Coding Questions
- Python Pattern Programming Questions
- Python Programming Interview Questions
- SQL Interview Questions
Rhombus Pattern Program In C Using Star
Below are the various examples of Rhombus patterns that are made using the combination of stars. This Rhombus pattern includes left and right inclined rhombus. And the program to print that Rhombus are written in C programming language.
And below C concepts are used to print that patterns
- For Loop
- While Loop
- if..else
1). Program to print right Inclined Solid Rhombus using star(*) in C
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n,k;
printf("Enter the number of rows for Rhombus: ");
scanf("%d",&n);
for(i=0;i<n;i++){
for(k=1;k<n-i;k++){
printf(" ");
}
for(j=0;j<=n;j++){
printf("*");
}
printf("\n");
}
getch();
}
Output
2). Program to print left inclined Solid Rhombus using star(*) in C
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n,k;
printf("Enter the number of rows for Rhombus: ");
scanf("%d",&n);
for(i=n;i>=1;i--){
for(j=1;j<=n-i;j++){
printf(" ");
}
for(k=1;k<=n;k++){
printf("*");
}
printf("\n");
}
getch();
}
Output
Latest Uploads on Website
- AVL Tree with explanation
- Radix sort algorithm explanation with example
- Quick Sort Algorithm with explanation
- Bubble sorting algorithm with Bubble sort program in C
- Insertion sort algorithm and program in C
- Selection Sort Algorithm and Program in C
- Linear probing technique explanation with example
- Collision in Hashing and Collision resolution technique
- Hashing in data structure with its types
- Binary search tree operations with Program
- Binary search tree in data structure
- Binary search algorithm in data structure with explanation
- linear search in data structure with Algo and Program