what is the different between if-else and switch statment
(other than syntax)
Answer Posted / bakhtiar khan wazir
IF Statement: Checks the value of data is less than or greater than. (in ranges).
example: can tell wether an input age is more than 18 and less than 60.
Switch Case: Checks the value of data that is prespecified. only equal to.
example: Can only generate output if the value matches. When the age is 18 or when the age is 60 . No comarison of data based on greater than or smaller than. Compares data based on equality.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is double pointer?
What does. int *x[](); means ?
What is atoi and atof in c?
Is array a primitive data type in c?
What are different storage class specifiers in c?
What is an lvalue in c?
What is the process to generate random numbers in c programming language?
how could explain about job profile
Can a pointer be static?
Define C in your own Language.
Why can arithmetic operations not be performed on void pointers?
What is file in c language?
How can I send mail from within a c program?
What is nested structure with example?
What does %c do in c?