Question
1. Write a function to test whether a given number is a multiple of 8. A one (1) is returned if the given number is
1. Write a function to test whether a given number is a multiple of 8. A one (1) is returned if the given number is a multiple of 8. Otherwise, a zero (0) is returned. The number to be tested is an integer and is an argument to this function.
2. Write a switch statement that will examine the value of an integer variable yy and assign one of the following values to the variable dd, depending on the value of yy:
(a)15, if yy == 1
(b)25, if yy == 2
(c) 35, if yy == 3
(d)45, if yy == 4
(e) 55, if yy == 5
3. Write a loop to compute the sum of the squares of the first 100 odd integers.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started