In this tutorial you will learn about the C Program to print exponentially Increasing Star Pattern and its application with practical example.
C Program to print exponentially Increasing Star Pattern
In this tutorial, we will learn to create a C program that will print an exponentially Increasing Star Pattern using C programming.
Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:
- Operators in C Programming.
- Basic Input and Output function in C Programming.
- Basic C programming.
- For loop in C Programming.
Program to print exponentially Increasing Star Pattern:-
In this program, we will learn to print exponentially Increasing Star Pattern with the help of c programming. First, we will take the input number of rows from the user. Then we will generate the series using the nested for loop to generate the series. Now we will print the series from the child loop using the print function.
Step 1: Start the program.
Step 2: Declaring the required variables.
Step 3: Taking the input number of rows.
Step 4: Generating the pattern using the loops.
Step 5: Printing the pattern using the print function.
Step 6: End the program.
/* C Program to Print Exponentially Increasing Star Pattern */
//declaring the required variables for the program
int rw, i, j;
//i = it will hold the integr value
//j = it will hold the integr value
//Taking the input number of rows.
printf("Please Enter the Number of Rows: ");
//Generating the exponential series.
printf("\nPrinting Exponentially Increasing Star Pattern \n");
for ( i = 0 ; i <= rw; i++ )
for ( j = 1 ; j <= pow(2, i); j++ )
//Printing the series.
In the above program, we have first initialized the required variable.
- i = it will hold the integer value to control the parent for loop.
- j = it will hold the integer value to control the child for loop.
- rw = it will hold the integer value for the number of rows of pattern.
Taking the input rows and Initializing the first parent for loop size and number of rows.
Generating the series.
Printing the exponential series.