Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. static void Main(string[] args)
  2.         {
  3.  
  4.             int[] array = { 3, 7, 2, 15, 11, 82, 64, 31 };
  5.             int maxInt = Int32.MinValue;
  6.  
  7.             for (int i = 0; i<array.Length; i++)
  8.             {
  9.                 int value = array[i];
  10.                 if (value > maxInt)
  11.                 {
  12.                     maxInt = value;
  13.                 }
  14.             }
  15.  
  16.             Console.WriteLine($"Najveci element niza je: {maxInt}");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement