-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday10.cpp
127 lines (122 loc) · 2.68 KB
/
day10.cpp
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#include<iostream>
#include<vector>
using namespace std;
int main()
{
// vector<int> v;
// cout<<"Size: "<<v.size()<<endl;
// cout<<"Capacity: "<<v.capacity()<<endl;
//
// v.push_back(1);
// cout<<"Size: "<<v.size()<<endl;
// cout<<"Capacity: "<<v.capacity()<<endl;
//
// v.push_back(2);
// cout<<"Size: "<<v.size()<<endl;
// cout<<"Capacity: "<<v.capacity()<<endl;
//
// v.push_back(3);
// cout<<"Size: "<<v.size()<<endl;
// cout<<"Capacity: "<<v.capacity()<<endl;
//
// v.resize(5);
// cout<<"Size: "<<v.size()<<endl;
// cout<<"Capacity: "<<v.capacity()<<endl;
//
// v.push_back(12);
// cout<<"Size: "<<v.size()<<endl;
// cout<<"Capacity: "<<v.capacity()<<endl;
// vector <int> v(6);
// cout<<"Enter the vector element"<<endl;
// for(int i=0;i<v.size();i++)
// {
// cin>>v[i];
// }
// //enter key to find
// int key;
// cout<<"Enter key to find:"<<endl;
// cin>>key;
//
// //for output
// int ans=-1;
// cout<<"The result is"<<endl;
// for(int i=0;i<v.size();i++)
// {
// if (v[i]==key)
// {
// ans=i;
// }
//
// }
// cout<<"The last occurance of given element:"<<key<<" is :"<<ans<<endl;
// cout<<"Count the number of occurance in the particular element:"<<endl;
//
// vector<int> n(6);
//
// cout<<"Enter the element for the vector"<<endl;
// for (int i=0;i<n.size();i++)
// {
// cin>>n[i];
// }
//
// //for output
// int key;
// cout<<"Enter key to found:"<<endl;
// cin>>key;
//
//
// //for output
// int total_count=0;
// cout<<"Output Here.."<<endl;
// for(int i=0;i<n.size();i++)
// {
// if(n[i]==key)
// {
// total_count++;
// }
// }
// cout<<"The total count is:"<<total_count<<endl;
// cout<<"Count the number of element stictly greater then value x"<<endl;
//
// vector <int> k(6);
//
// //for taking input
// cout<<"Manually Enter the element:"<<endl;
// for(int i=0 ;i<k.size();i++)
// {
// cin>>k[i];
// }
//
// //enter the ele to find from the vector.
// int ele;
// cout<<"Enter the element:"<<endl;
// cin>>ele;
//
// //for output
// int count=0;
// for (int i=0; i<k.size();i++)
// {
// if (k[i] > ele)
// {
// count++;
// }
// }
// cout<<"Total number that are stricty greater then ele:"<<count<<endl;
cout<<"Check the given array is sorted or not:"<<endl;
int arr[5];
//for inout
for(int i=0;i<5;i++)
{
cin>>arr[i];
}
//output
bool isflag=true;
for(int i=0;i<5;i++)
{
if (arr[i] <= arr[i-1])
{
isflag=false;
}
}
cout<<"The given array is:"<<isflag<<endl;
}