This repository was archived by the owner on Jul 20, 2023. It is now read-only.
File tree 2 files changed +44
-1
lines changed
2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 40
40
- [ Rabin Khatiwada] ( https://github.com/rabinkhatiwada )
41
41
- [ Adrian Hernandez-Lopez] ( https://github.com/AdrianHL )
42
42
- [ Juan Benitez] ( https://github.com/juanbenitez )
43
- - [ Chaiyapat Tantiworachot] ( https://github.com/pixelart7 )
43
+ - [ Chaiyapat Tantiworachot] ( https://github.com/pixelart7 )
44
+ - [ Taha Bin Aziz] ( https://github.com/tahabinaziz )
Original file line number Diff line number Diff line change @@ -25,3 +25,45 @@ private void Shuffle(string[] e)
25
25
}
26
26
}
27
27
```
28
+ # C# ;
29
+
30
+ ## Minimum And Maximum Number
31
+
32
+ ``` csharp
33
+ int [] arr1 = new int [100 ];
34
+ int i , mx , mn , n ;
35
+
36
+
37
+ Console .Write (" \n\n Find maximum and minimum element in an array :\n " );
38
+ Console .Write (" --------------------------------------------------\n " );
39
+
40
+ Console .Write (" Input the number of elements to be stored in the array :" );
41
+ n = Convert .ToInt32 (Console .ReadLine ());
42
+
43
+ Console .Write (" Input {0} elements in the array :\n " ,n );
44
+ for (i=0;i < n ;i ++ )
45
+ {
46
+ Console .Write (" element - {0} : " ,i );
47
+ arr1 [i ] = Convert .ToInt32 (Console .ReadLine ());
48
+ }
49
+
50
+
51
+ mx = arr1 [0 ];
52
+ mn = arr1 [0 ];
53
+
54
+ for (i=1; i < n ; i ++ )
55
+ {
56
+ if (arr1 [i ]> mx )
57
+ {
58
+ mx = arr1 [i ];
59
+ }
60
+
61
+
62
+ if (arr1 [i ]< mn )
63
+ {
64
+ mn = arr1 [i ];
65
+ }
66
+ }
67
+ Console .Write (" Maximum element is : {0}\n " , mx );
68
+ Console .Write (" Minimum element is : {0}\n\n " , mn );
69
+ ```
You can’t perform that action at this time.
0 commit comments