what is the different between if-else and switch statment
(other than syntax)

Answer Posted / vikky

expressions cannot be used as arguments in switsh, but in
if else any kind of exp can be used...
in the case of checkin a single variable for several values
SWITCH is the BEST.
in all other cases if else holds gud.

Is This Answer Correct ?    36 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is boolean in c?

615


Explain the difference between getch() and getche() in c?

567


What is pass by reference in functions?

327


What is variable and explain rules to declare variable in c?

558


How can I recover the file name given an open stream?

556






Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.

630


What is the Purpose of 'extern' keyword in a function declaration?

656


How do I swap bytes?

634


Explain the advantages of using macro in c language?

585


Where is volatile variable stored?

657


What is getche() function?

613


What are the advantages of using Unions?

647


struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer

770


What are the functions to open and close the file in c language?

597


Explain the use of fflush() function?

631