Haval1

quastion 2

May 15th, 2018
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int i=1,num=1;
  6.     while(i<=5)
  7.     {
  8.         int j=0;
  9.         while(j<num)
  10.         {
  11.             cout<<i<<"\t";
  12.             j++;
  13.         }
  14.         cout<<endl<<endl;
  15.         i++;
  16.         num++;
  17.        
  18.     }
  19.     cout<<"\n1------------------------------\n";
  20.     int y=6;
  21.     i=0;
  22.     while(i<5)
  23.     {   int j=1;
  24.         while(j>=2)
  25.         {
  26.             cout<<j<<"\t";
  27.             j++;
  28.         }
  29.         cout<<endl<<endl;
  30.         i++;
  31.         y--;
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment