Created
July 22, 2015 12:38
-
-
Save ikariiin/4b29ea39e0cf292cab9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//============================================================================ | |
// Name : Pattern.cpp | |
// Author : Gourab Nag | |
// Version : 1.0 | |
// Copyright : None | |
// Description : Triangular Pattern in C++, Ansi-style | |
//============================================================================ | |
#include <iostream> | |
#include <iomanip> | |
#include <string> | |
using namespace std; | |
void star(int rows); | |
bool isValid(int input); | |
int main() { | |
int noRow; | |
cout << "Enter The No Of Rows You Wanna Print: \n"; | |
cin >> noRow; | |
star(noRow); | |
return 0; | |
} | |
void star(int rows) | |
{ | |
int curRow = 1; | |
for(int i = 0; i <= rows; i++) | |
{ | |
cout << setfill('*') << setw(curRow) << "\n"; | |
curRow = curRow + 1; | |
} | |
} | |
bool isValid(int input) | |
{ | |
if(input <= 10000) | |
{ | |
return true; | |
} | |
else | |
{ | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment