Advertisement
Guest User

hw4.cpp

a guest
Mar 29th, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cstdlib>
  4. #include <fstream>
  5. #include <string>
  6. using namespace std;
  7.  
  8.  
  9. int main()
  10. {
  11.   int num;
  12.   cout<<"Enter a number between 1 & 79: ";
  13.   cin>>num;
  14.   while(num<1||num>79)
  15.     {
  16.       cout<<"Enter a number between 1 & 79: ";
  17.       cin>>num;
  18.     }
  19.   int count=1;
  20.   int cnt=1;
  21.   while(count<=num)
  22.     {
  23.       cnt=0;
  24.       while(cnt<count)
  25.         {
  26.           cout<<"*";
  27.           cnt++;
  28.         }
  29.       cout<<endl;
  30.       count ++;
  31.     }
  32.   return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement