CS201 GDB Solution 2017
CS201 GDB 2017
cs201 GBD no 1 solution ka solution plz send
(01-07-2018, 12:35 PM)Adeel Ahmad Wrote: cs201 GBD no 1 solution ka solution plz send

Here is the solution of CS201 GDB Fall 2017 CS201 GDB 1 Solution Fall 2017
Switch statement is much faster than if-else due to the following reasons:
Switch statement is better because
1) Compiler generates a jump table during compilation.
2) Instead of checking which case is true, it only moves to that case which has to be executed.
3) It is more readable.
4) It is more manageable regarding above scenario.

In my opinion, switch statements id better than If-Else. Switch statements have its best uses then there are more environments. As we know that if statements checks for all the conditions and then when the condition is matched then the following body inside it is executed but this is not the case with switch condition as it directly checks for the compatible conditions and executes the code.
The reason behind the selection of switch statement is;
Working speed of switch statement is much faster than if-else.
The reason is that compiler produces a jump table for a switch in the course of assembling. Thus, during accomplishment, as a substitute of testing which case is contented, it only picks which case has to be accomplished.
It is more understandable and in parallel to if-else testimonials.
Switch statement is more manageable for taking higher level of transactions than if-else

Possibly Related Threads...
Thread Author Replies Views Last Post
  cs201 GBD no 1 solution fahadmukhtar 1 457 01-07-2018, 10:12 AM
Last Post: Admin
  CS201 Assignment 2 Solution Fall 2017 Admin 0 339 11-22-2017, 09:09 PM
Last Post: Admin
  CS201 VIVA Questions and Answers Pakistani 1 4,236 02-06-2017, 05:26 PM
Last Post: Admin
  CS201 Assignment#2 Solution by Aly Hamza Aly Hamza 0 1,745 06-23-2016, 02:55 PM
Last Post: Aly Hamza
  CS201 Spring 2016 Assignment #1 Solution Aly Hamza 2 1,810 05-11-2016, 10:18 AM
Last Post: Rubaisha(Moody Girl)

Users browsing this thread:
1 Guest(s)