Tuesday, 25 August 2015

1 12 123 1234 12345

#include"stdafx.h"
#include<iostream>
usingnamespace std;
int main()
{
for(int i=1; i<=5; i++)
{
for(int j=1; j<=i; j++)
{
cout<<j ;
}
cout<<endl;
}
system("pause");
return  0;
}

18 comments:

  1. #include
    using namespace std;
    int main()
    {
    int i,j,n;
    cout<<"enter the value";
    cin>>n;
    for(i=1;i<=n;i++)
    {
    for(j=1;j<=i;j++)
    {
    cout<<j;

    }

    cout<<"\n";

    }

    return 0;
    }

    ReplyDelete
    Replies
    1. no its print the proper i make this.it print o/n,1/n,2/n....so on.

      Delete
  2. I want this
    1
    12
    123
    1224....

    ReplyDelete
    Replies
    1. #include
      using namespace std;
      int i,j,n;
      int main()
      {
      cout<<"Dati n: ";
      cin>>n;

      for(i=1;i<=n;i++)
      {
      for(j=1;j<=i;j++)
      {
      cout<<j<<"";
      }
      cout<<endl;
      }
      return 0;
      }

      Delete
  3. How do you write that orogram using while loop?

    ReplyDelete
  4. 1 1
    12 21
    123 321
    1234 4321
    1234554321

    ReplyDelete
  5. 1________1
    12______21
    123____321
    1234__4321
    1234554321

    ReplyDelete
  6. How do I print
    1234
    1234
    1234
    1267

    ReplyDelete
    Replies
    1. #include
      using namespace std;
      int main(){
      //problem no 3
      for(int i=1; i<=4; i++)
      {
      for(int j=1; j<=4; j++)
      {
      cout<<j;
      }
      cout<<endl;
      }


      return 0;
      }

      Delete
  7. how can I do the same program with while loop

    ReplyDelete
  8. Replies
    1. #include

      using namespace std;

      int main()
      {
      int n;
      int x=1;
      int y=0;
      int m=x;
      for(n=0;n<=4;n++)
      {
      cout<<x;
      y=y+1;
      n=0;
      for(int i=0;i<y;i++)
      {
      n=n+1;
      m=n+1;
      cout<<m;
      }
      cout<<endl;
      }
      return 0;
      }

      This is how to do it

      Delete
  9. Merkur | Best and Top Reviewed 2021 by VGT - Curacao
    Merkur are a very popular deccasino European online bingo product which หารายได้เสริม means that it has choegocasino a lot of positive and In short, the Merkur brand has a lot of cool features in its

    ReplyDelete