what is the different between if-else and switch statment
(other than syntax)
Answer Posted / nilesh dinakr
In IF STATEMENT, we can build the logical conditin i.e.
usinf realtional operator but in SWITCH, we can use the
expression which yield int or char value but not float.
char value will be auoto typecast to int. shortly , switch
works only one int
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What does void main return?
What is the newline escape sequence?
Why we use stdio h in c?
What is a void pointer in c?
How can I generate floating-point random numbers?
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
What is the difference between if else and switchstatement
What is #include stdio h and #include conio h?
Write a function that will take in a phone number and output all possible alphabetical combinations
Write a program to swap two numbers without using the third variable?
Is null a keyword in c?
List the difference between a While & Do While loops?
what is a constant pointer in C
Explain how do you determine the length of a string value that was stored in a variable?
What is the c value paradox and how is it explained?