pattern qsn

 int main(){

    int n,d;

    cin>>n;

    d=1;

    for (int i=1;i<=n;i++){

        for (int j=1;j<=i;j++){

            cout<<d;

            d=d+1;

        }

        printf("\n");

    }

   //int n;

   //cin>>n;

   //int i=1;

   //while( i<=n){

   //    int j=1;

   //    while(j<=i){

   //        cout<<j;

   //        j=j+1;

   //    }

   //    cout<<endl;

   //    i=i+1;

        


    


     

    

    

    

}

Comments

Popular posts from this blog

Sum of Even Numbers till N

Find the Runner-Up Score!

Print All Substrings