Program to print parallelogram pattern in c++ language using while
Program to print parallelogram pattern in c++ language
In this article, we will discuss the concept ofProgram to print parallelogram pattern in c++ language using while loop
In this post, we are going to learn how to write a program to print parallelogram and Hollow parallelogram pattern using while loop in C++ language.
Display parallelogram star patterns Using while loop
Code to print Parallelogram star pattern
Parallelogram star pattern
Program 1
This program allows the user to enter the number of rows , columns and any symbol then it will display the parallelogram star pattern using while loop in C++ programming language
#include
#include
using namespace std;
using namespace std;
int main() {
int i,j,rows,columns;
//integer variable declaration
char ch;
//char variable declaration
cout>rows;
//Store the row in the rows variable entered by user
cout>columns;
//Store the column in the columns variable entered by user
cout>ch;
//Store the char in the character variable entered by user
cout
When the above code is executed, it produces the following result
parallelogram star pattern
Code to print Hollow Parallelogram star pattern
Hollow Parallelogram star pattern
Program 2
This program allows the user to enter the number of rows , columns and any symbol then it will display the Hollow parallelogram pattern using while loop in C++ programming language
#include
#include
using namespace std;
int main() {
int i,j,rows,columns;
char ch;
cout>rows; //store the user input- rows
cout>columns; //store the user input- columns
cout>ch;
cout
When the above code is executed, it produces the following result