Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.82 KB | None | 0 0
  1. Write a program that reads a number N. This N is the size of a array X[N]. Next, read each of the numbers of X, find the smallest element of this array and its position within the array, printing this information.
  2.  
  3. Input
  4. The first line of input contains one integer N (1 < N <1000), indicating the number of elements that should be read to an array X[N] of integer numbers. The second row contains each of the N values, separated by a space.
  5.  
  6. Output
  7. The first line displays the message “Menor valor:” followed by a space and the lowest number read in the input. The second line displays the message “Posicao:” followed by a space and the array position in which the lowest number is, remembering that the array starts at the zero position.
  8.  
  9. Input Sample    Output Sample
  10. 10
  11. 1 2 3 4 -5 6 7 8 9 10
  12.  
  13. Menor valor: -5
  14. Posicao: 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement