Skip to main content

Pattern

/*
To print:
                *   
            *   *   
        *   *   *   
    *   *   *   *   
*   *   *   *   *   

*/


#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 n;
    cin>>n;
    
    for(int i=1;i<=n;i++){
        for(int s=0;s<n-i;s++)
            cout<<"\t";
        for(int p =0;p<i;p++)
            cout<<"*\t";
        cout<<endl;
    }
    
    return 0;
}

Comments

Must Read:

Data Formats ( XML & JSON ) XML AND JSON | Pre-Quiz

  Feedback Congratulations!! You have passed by securing more than 80% Question  1 Correct Mark 1.00 out of 1.00 Flag question Question text What is the correct syntax in HTML for creating a link on a webpage? Select one: <link src="mcqsets.html"> <a href="mcqsets.html">   <a src="mcqsets.html"> <body link="mcqsets.html"> Feedback Your answer is correct. The correct answer is: <a href="mcqsets.html"> Question  2 Correct Mark 1.00 out of 1.00 Flag question Question text What are the new features in HTML5? Select one: All of these   Canvas element is provided for 2D drawing Better support for local storage Video and audio elements are available for media playbacK New form controls like calendar, date, time, email, URL, search  Feedback Your answer is correct. The correct answer is: All of these Question  3 Correct Mark 1.00 out of 1.00 Flag question Question text ____________ is the HTML5 attribute that speci...

DFA Solutions

  Question  1 Correct Mark 1.00 out of 1.00 Flag question Question text To secure the http messages in the API calls, its necessary to: Select one: a. All the above b. Use cryptography c. implement identity management d. avoid hardcoding any sensitive data in the messages Feedback The correct answer is: All the above Question  2 Correct Mark 1.00 out of 1.00 Remove flag Question text A team has completed 10 Sprints and moving to the 11th Sprint. Till Sprint 10, the team has achieved an average of 50 story points per sprint. The same is projected as their velocity for the upcoming sprints with the Client. What is this approach called? Select one: a. Velocity Driven Sprint Planning b. Velocity Driven Commitment c. Commitment Driven Velocity d. Commitment Driven Sprint Planning Feedback The correct answer is: Velocity Driven Sprint Planning Question  3 Incorrect Mark 0.00 out of 1.00 Remove flag Question text Jack is grooming himself to be a potential Product Owner. Kno...

Subscribe to Get's Answer by Email