Documente Academic
Documente Profesional
Documente Cultură
Sample output:
Value at s [ 0 ] is 0
Value at s [ 1 ] is 1
Value at s [ 2 ] is 8
Value at s [ 3 ] is 27
Value at s [ 4 ] is 64
Value at s [ 5 ] is 125
Value at s [ 6 ] is 216
Value at s [ 7 ] is 343
Value at s [ 8 ] is 512
Value at s [ 9 ] is 729
The sum of all elements of array is: 2025
Sample array: int s[] = { 2, 34, 18, 45, 89, 100, 23, 67 }
Sample output:
Enter search value: 18
Search completed! Value found at index 2 of array.
Enter search value: 95
Search completed! Value not found.
…
Task 3: (Searching using function)
Write a program that searches an array for the given integer using functions and that
function returns its position in the array.