Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3) . Write a C program to read the value of an integer m and display the value of n is I when m is

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
3) . Write a C program to read the value of an integer m and display the value of n is I when m is larger than 0, 0 when m is 0 and -1 when m is less than 0 Write a C program to accept a coordinate point in a XY coordinate system and determine in which quadrant the coordinate point lies 4) The game of Fizz Buzz involves counting 1, 2, 3 etc except that if a number is divisible by three the person says "Fizz" instead of that number, and if it is divisible by five they say "Buzz". If it is divisible by both three and five they say "F Write a program that reads in an integer from the keyboard and uses an if . else if statement to print out "Fizz", "Buzz", "FizzBuzz" or the number according to the above rules. Make sure that each printf) statement appears only once. 5) zzBuzz" 6) The wavelength of visible light ranges from 380 to 750 nanometers (nm). While the spectrum is continuous, it is often divided into 6 colors as shown below: Color Violet Blue Green Yellow Orange Red Wavelength (nm) 380 to less than 450 450 to less than 495 495 to less than 570 570 to less than 590 590 to less than 620 620 to 750 Write a program that reads a wavelength from the user and reports its color. Display an appropriate error message if the wavelength entered by the user is outside of the visible spectrum. 7) Rewrite the following if-else chain by using a switch statement: if (letterGradeA) else if (letterGrade B') else if (letterGrade-"C) printf The numerical grade is between 90 and 100m") printf The numerical grade is between 80 and 89un"); print The numerical grade is between 70 and 79'm; printf "How are you going to explain this one?n"); printf'Of course I had nothing to do with my grade n" else printf"It must be the professor's fault'in") Write a program that serves as a simple calculator. This program wi integer numbers and an operator like +,-,..% and then print the result according to given operator. Use a switch statement. 8) ll read two Sample output First run: Enter first number: 10 Enter second number: 20 Choose operation to perform (+,-,-/%): + Result: 10 + 20 = 30.000000 Second run: Enter first number: 10 Enter second number: 3 Choose operation to perform (+,-,*J,%): / Result: 10/3- 3.333333 Third run: Enter first number: 10 Enter second number: 3 Choose operation to perform (+,-,*/99: > Invalid operation. Result: 10 >3 0.000000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions