Erle Robotics C++ GitBook

Exercises: Arrays

Exercise 1

Create an array that can hold ten integers, and get input from user. Display those values on the screen, and then prompt the user for an integer. Search through the array, and count the number of times the item is found.

Solution

Exercise 2

Write a program that asks for an index and a number. Then it includes the number at the indicated index of the array ={1,2,3,4,5,6} and moves a position forward (from u to u+1) each element after the selected index.

Solution

Exercise 3

Write a program that reverses a string and prints it on the screen.

Solution