Five programming exercises with numbers that will help you develop your logic.
Find the largest number from the following series of 7 numbers
In this exercise you have to the find the largest number from the following series
10,12,15,3,5, 22, 2
- Store the numbers in an array
- Make use of temp variable to store the greater when comparing 2 of them
- Write a for loop to compare all the other numbers
In this exercise your task is to list guests in a tabular format from the array you created in the previous exercise Greet the guests
List guests table
Use the table below to list guests
List guests hints
In this exercise you have to greet the guests you have invited for your birthday party.
The guest list comprises of men, women, kids (boys and girls)
Your task is load the name of one guest randomly on every page refresh and greet the guests depending on their gender. for eg.
Greet the guests example
- Jane Austen is a women, so say Hello Mrs.. Austen
- George Orwell is a man, so say Hello Mr. Orwell
- Isaac Newton was knighted, so say Hello Sir Newton
- Zehen is a boy, so say Hello Master Zehen
Greet the guests hints
- Create a 2 dimensional array named guest if you are coding in php. The array should store the name and gender.
- Load one row/record randomly
- Make use of if else condition to check the gender
- Alternative you can also make use of switch case of check the gender
Write the code in your favorite programming language.
Greet the guests solutions