Advertisement
Guest User

Untitled

a guest
Dec 15th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. main() {
  4.     int pole[] = {1, 5, 9, 7, 8, 6, 3, 4, -1, 5, 8, -10, -5, -58, 52, 69, 58, 70, 100, 5, 23, 45, 85};
  5.     int i;
  6.     int cis = 0;
  7.     int index;
  8.  
  9.     for (i = 0; i < sizeof(pole) / sizeof(int); i++) {
  10.         if (pole[i] > cis) {
  11.             cis = pole[i];
  12.             index = i;
  13.         }
  14.  
  15.     }
  16.     printf("Nejvetsi cislo je: %d s indexem: %d\n", cis, index);
  17.     system("pause");
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement