forked from sachin-nono/codingpractice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrianglePatternRecursion.cpp
More file actions
59 lines (47 loc) · 846 Bytes
/
TrianglePatternRecursion.cpp
File metadata and controls
59 lines (47 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<<<<<<< HEAD:RECUR1.CPP
/*WAP to print a pattern by recursion*/
//Enter what is asked and wait and dont press enter!!!
#include<iostream>
//#include<cstdlib>
//#include"dos"
using namespace std;
int y=0;
=======
/*
WAP to print a pattern by recursion
*/
#include<iostream>
#include<cstdlib>
using namespace std;
int y=0;
>>>>>>> c700d35abf4555cbf59093ede5d46135a128dc5d:Triangle Pattern 2 using Recursion.cpp
int main()
{
void recursion(int);
int x;
cout<<"Enter no of rows:";
cin>>x;
recursion(x);
<<<<<<< HEAD:RECUR1.CPP
=======
>>>>>>> c700d35abf4555cbf59093ede5d46135a128dc5d:Triangle Pattern 2 using Recursion.cpp
return 0;
}
void recursion(int x)
{
if(y!=x)
{
for(int i=y;i>-1;i--)
cout<<"*"<<"\t";
cout<<endl;
y++;
recursion(x);
}
else
{
//sleep(1);
cout<<"\nGood Bye!!!";
//sleep(1);
//exit(1);
}
}