-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdec1.cpp
More file actions
36 lines (26 loc) · 689 Bytes
/
dec1.cpp
File metadata and controls
36 lines (26 loc) · 689 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
#include <iostream>
using namespace std;
void max_and_small_Calculator(int nums[], int size);
int main()
{
const int SIZE = 10;
// int temp = 0;
int numbers[SIZE] = {10, 9, 2, 8, 3, 7, 1, 23, 14, 17};
max_and_small_Calculator(numbers, SIZE);
return 0;
}
void max_and_small_Calculator(int nums[], int size)
{
int l = nums[0];
int s = nums[0];
for(int i = 1; i < size; i++ )
{
//cout << nums[i] << endl;
if(nums[i] > l)
l = nums[i];
if(nums[i] < s)
s = nums[i];
}
cout << "The biggest number is: " << l << endl;
cout << "The smallest number is: " << s << endl;
}