Coding-Trick: Switch-Case as unWorkable for loop

While working, I thought I could provide few tips on coding in my blog.

So, I thought to share a "short code" in a situation where you want to initialize some values. Each value is initialized by different function. You know the functions but you don't know how many values to initialize.  Uninitialized values should be 0.

Suppose values to initialize

a = f1(); 
b = f2(); 
c = f3(); 
d = f4(); 

 A normal Switch case for the above Situation :

Switch(number_of_values_to_initialize) {

case 1:
          a = f1();
          b = 0;
          c = 0;
          d = 0;
          break;

case 2:
          a = f1();
          b = f2();
          c = 0;
          d = 0;
          break;

case 3:
          a = f1();
          b = f2();
          c = f3();
          d = 0;
          break;

case 4:
          a = f1();
          b = f2();
          c = f3();
          d = f4();
          break; }


 The Shortcut for This Code is :

Relationship Hack (Whatsapp Again)

-as Suggested by Adarsh Sambare


Consider a case when you are stressed and tensed and you get a message on your phone. You know whose message it is. You look on the phone and then what you look will define your mood.

What if you look and you find :


I know your anger will surely shoot up and unnecessarily fights will occur.

What if you don't see the person you were going to fight but the love you cant get away from.

Something like this:


Just Change the contact name with his/her nickname or any pet name.
Now go Try by Yourself.




For Part one Click Here

YOU MAY ALSO LIKE: