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

Answer Posted / thiyagu.p

Simply saying, IF-ELSE can have values based on constraints
where SWITCH can have values based on user choice.

Is This Answer Correct ?    187 Yes 42 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is const and volatile in c?

561


the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above

602


program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)

1620


What is the difference between a free-standing and a hosted environment?

640


What are different types of operators?

592






Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.

1565


How would you rename a function in C?

614


What is extern keyword in c?

639


In a switch statement, explain what will happen if a break statement is omitted?

632


Explain how can I make sure that my program is the only one accessing a file?

618


Why should I use standard library functions instead of writing my own?

668


Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.

1718


Explain how do you declare an array that will hold more than 64kb of data?

897


If you know then define #pragma?

672


How can I read/write structures from/to data files?

546