Skip to main content

Star Pattern

 /* @ToDo 


   Star Pattern 
                *   
            *   *   *   
        *   *   *   *   *   
    *   *   *   *   *   *   *   
*   *   *   *   *   *   *   *   *   
*   *   *   *   *   *   *   *   *   
    *   *   *   *   *   *   *   
        *   *   *   *   *   
            *   *   *   
                *   

   
   
*/


#include <iostream>
using namespace std;

int main(){
     #ifndef ONLINE_JUDGE
        freopen("../asset/input.txt","r",stdin);
        freopen("../asset/output.txt","w",stdout);
    #endif
    // Code here!!

    int ncin>>n;
    for(int i=1;i<=n;i++){
        for(int j=0;j<n-i;j++)
            cout<<"\t";
        for(int j=1;j<2*i;j++)
            cout<<"*\t";
        cout<<endl;
    }
    for(int i=n;i>0;i--){
        for(int j=0;j<n-i;j++)
            cout<<"\t";
        for(int j=1;j<2*i;j++)
            cout<<"*\t";
        cout<<endl;
    }

    return 0;
}

Comments

Must Read:

Number Pattern

  /* @ToDo     Number Pattern                 1                    1       2                1       2       3            1       2       3       4        1       2       3       4       5            */ #include   <iost...

RDBMS Data Definition Language | Alter - Establish Referential Integrity Constraint

RDBMS  Data Definition Language  Alter - Establish Referential Integrity Constraint Identify the common key between the customer_info and Sales_info tables and establish referential integrity constraint between them. Give the constraint name as FK_KEY. Evaluation Result: Result Description Summary of tests +------------------------------+ | 3 tests run / 3 test passed | +------------------------------+

Subscribe to Get's Answer by Email