Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is double pointer?

994


What does. int *x[](); means ?

1064


What is atoi and atof in c?

1084


Is array a primitive data type in c?

1055


What are different storage class specifiers in c?

1089


What is an lvalue in c?

1122


What is the process to generate random numbers in c programming language?

1175


how could explain about job profile

1916


Can a pointer be static?

1070


Define C in your own Language.

1076


Why can arithmetic operations not be performed on void pointers?

1039


What is file in c language?

1000


How can I send mail from within a c program?

1024


What is nested structure with example?

1070


What does %c do in c?

984