Zaki Mirza’s Blog

Icon

… About software and beyond!

Quiz #3: What if there were no ‘if’?


Last monday i reached office pretty late since i had to attend my lectures at univ. There was a power fluctuation problem in the whole building and the MIS had requested everyone not to turn on their PCs. So most of the people were either chilling in their cabins chatting or had left. I hung out for a while with a bunch of senior FAST graduates discussing some tecchie gossip and then i moved to the break room. There were some other employees sitting there and were discussing a very thoughtful problem. The problem being my quiz number 3. Its goes something like this:

Given a language that does not have an IF construct, how do you go on about executing different code over a condition? For example call code-block A if condition C is true, and B is condition C is false.

The discussion was going on among some 4-5 employees and since they were pretty seniour to me, (me being just another intern) i was un-noticed. Anyways, have your say in it and ill answer this shortly from my own perspective. (maybe its one of those interview questions, but then again its intresting).

Advertisements

Filed under: programming, quiz, ,

One Response

  1. algorithm says:

    if a language doesn’t have any CONDITIONAL feature then
    during the run time a condition can be posed and using a looping function a code can be executed till the value is obtained
    like suppose if C=5 then a=100 else a=121
    then take from user some c=20 , keep it in a decementing loop if the loop is true assign a=100 else other

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

RSS Google Shared Items

  • An error has occurred; the feed is probably down. Try again later.

RSS Google Reader Starred Items

  • An error has occurred; the feed is probably down. Try again later.

Top Clicks

  • None
%d bloggers like this: