Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the mistake in the below switch statement? double a= 1.25; switch(a){ case 1.1: case 1.2: x= x*x; y= x; break; case 1.3: y=

What is the mistake in the below switch statement?

double a= 1.25;

switch(a){

case 1.1: case 1.2:

x= x*x; y= x; break;

case 1.3: y= x*x;

case 2.1: case 3.3:

y= sqrt(x); break;

case 3.5: printf(Error ); break;

default: y= x+1;

a) case 1.3 has no break

b) default doesnt have printf

c) a = 1.25 is not matched.

d) switch works only with integers

e) case 3.5 doesnt need break

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

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

Identify sustainable HRM practices in an organization.

Answered: 1 week ago

Question

How would you describe the new culture?

Answered: 1 week ago