which of the following types of variable cannot be checked in switch case statement
1char 2int 3float 4enum
Answers
Answer:
Option 3
Explanation:
The switch/case statement in the c language is defined by the language specification to use an int value, so you can not use a float value.
switch( expression )
{
case constant-expression1: statements 1;
case constant-expression2: statements 2;
case constant-expression3: statements3 ;
...
...
default : statements 4;
}
The value of the 'expression' in a switch-case statement must be an integer, char, short, long. Float and double are not allowed.
Answer:
The Correct answer would be 3. float. Float can't be checked in switch case statement.
Explanation:
Switch case statement evaluates a given expression and primarily based totally at the evaluated value (matching a sure situation), it executes the statements related to it. Basically, it's miles used to carry out different moves primarily based totally on different conditions(cases).
- Switch case statements observe a selection-control mechanism and permit a value to extrade control of execution.
- They are an alternative to lengthy if statements that examine a variable to numerous integral values.
- The switch statement is a multiway department declaration. It gives a smooth manner to dispatch execution to different components of code primarily based totally at the value of the expression.
In C++, the switch statement is used for executing one situation from a couple of conditions. It is just like an if-else-if ladder.
To know switch case is similar to which statement : https://brainly.in/question/42751021
To know how to terminate case with switch statement : https://brainly.in/question/42678024