0% found this document useful (0 votes)
6 views5 pages

Arrays Programming Exercises Guide

The document contains exercises for working with single and two-dimensional arrays in programming. It includes tasks such as searching for a number in an array, finding the longest name from user input, counting even numbers, and performing operations on a two-dimensional array. Each exercise outlines specific user interactions and expected outputs.

Uploaded by

mrad08045
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views5 pages

Arrays Programming Exercises Guide

The document contains exercises for working with single and two-dimensional arrays in programming. It includes tasks such as searching for a number in an array, finding the longest name from user input, counting even numbers, and performing operations on a two-dimensional array. Each exercise outlines specific user interactions and expected outputs.

Uploaded by

mrad08045
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Arrays: Exercises

Single Dimensional Array

1:

Write a program that asks the user to enter 5 numbers, then asks him to enter another number to
search for. The program should print whether the number exists in the array or not.

2:

Write a program that asks the user to enter 4 names, then prints the longest name among them.
3:

Write a program that:

▪ Asks the user to enter 5 numbers


▪ Stores them in an array
▪ Counts and prints the number of even values
Two Dimensional Array

1:

Write a program that:

▪ Declares a 2×2 two-dimensional array.


▪ Asks the user to enter the elements of the array.
▪ Prints all the elements of the array.
2:

Write a program that:

▪ Declares a 2×2 two-dimensional array.


▪ Asks the user to enter the elements of the array.
▪ Calculates and prints the sum of all elements in the array

You might also like