# C101 Laboratory Session #9 solved

\$35.00

## Description

5/5 - (1 vote)

Lab Goals 1) Learning how to write functions with static variables.
2) Learning how to use the ternary operator.
This lab requires you to write a program that has user continue to enter numbers until a 0
is entered to quit. After each integer is entered a function is then called. This function
will determine if the number passed in is an even number or odd. The function will keep
a running total of all the even and odd numbers the user has entered, and after every third
time the function is called, the number of even numbers entered will be displayed.
This function will be a void function and will have only one value parameter. The
function must have three static variables and the function must use the ternary operator in
some way. The best would be in incrementing the variable for number of evens and
odds. Before you use the ternary operator, first write it using a standard “if-else”
statement, then take this and convert it to the ternary operator.