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


Please Help Members By Posting Answers For Below Questions

What is selection sort in c?

613


Difference between linking and loading?

698


in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none

608


The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

669


What are directives in c?

550






How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

1594


What is difference between structure and union in c?

551


How to declare a variable?

575


What is a good way to implement complex numbers in c?

599


Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

664


What is a volatile keyword in c?

644


What is static volatile in c?

580


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

1596


Between macros and functions,which is better to use and why?

1572


What is the difference between mpi and openmp?

738