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

How can I dynamically allocate arrays?

588


the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function

756


Is c is a high level language?

618


using only #include and #include Write a program in C that will read an input from the user and print it back to the user if it is a palindrome. The string ends when it encounters a whitespace. The input string is at most 30 characters. Assume the string has no spaces and distinguish between and lowercase. So madam is a palindrome, but MadAm is not a palindrome. Use scanf and %s to read the string. Sample Test: Enter a string: madam madam is a palindrome. Enter a string: 09023 09023 is not a palindrome.

1310


Where register variables are stored in c?

547






What is an auto variable in c?

750


GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA

1425


Explain how do you list a file’s date and time?

615


What is the use of in c?

576


write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

1672


How can this be legal c?

648


What is a structure member in c?

541


What is the difference between Printf(..) and sprint(...) ?

780


Why & is used in c?

711


formula to convert 2500mmh2o into m3/hr

493