Posts

Showing posts with the label Star pattern

How To Print Given Star Pattern.

Image
What will be the solution of given star pattern? Fig:- 1 This program is executed on DEV C++ editor. You may use any C or C++ editor to execute the program logic will be same. Step that you have to follow for this programming logic. Step 1:- We have to draw a box which will contain 5 rows and 5 column. Fig:-2 Step 2:- We have drawn a box with rows and 5 columns. Now we have to think about its logic portion. Logic for printing star:- If column is smaller then or equal to 5 - row then only we have to print star. Other wise print blank space. Programming:- #include<stdio.h> #include<conio.h> int main() { int row,col;      //Variable deceleration  for (row=0;row<=4;row++)    //Loop for rows { for (col=0;col<=4;col++)  //Loop for column { if (col>=(4-row))      //Condition for printing star { printf(" *");     } else                ...

How to print star pattern.

What will be the solution of the given star pattern?                                           *                                         **                                       ***                                     ****                                   ***** This programming is executed on DEV C++ editor. You may use any C editor to execute this programming it will be same for all editor.  #include<stdio.h> #include<conio.h> int main() { int row,col;            ...

How to Print Given Star Pattern

Image
What will be the general solution of given star patter in C programming language. This program is executed on Dev C++ editor. You may use any other editor the program will be same. If you face any problem then comment. 1st way #include<stdio.h> #include<conio.h> int main() { int row ,col, n;                                              //Data type declaration printf("Enter the number of rows"); scanf("%d",&n);                                        // Taking user input for number of rows for(row=1;row<=n;row++)                       // For number of rows { for(col=n;col>=row;col--)                //For number of columns { printf("*")...

How to print given star pattern.

Image
What we be the general solution of given star pattern in C programming language.                                                                      This programming is executed on Dev C++ editor. You may run this programming program on any C or C++ editor. 1st way for Star pattern programming. #include<stdio.h>          #include<conio.h> int main() { int row, col, n;                                         // data type deceleration.         printf("Enter The number of row"); scanf("%d",&n);                                  ...