Conditional IF STATEMENT

Conditional IF STATEMENT

simplemind

JF-Expert Member
Joined
Apr 10, 2009
Posts
16,418
Reaction score
9,209
A programmer is going to the grocery store and his wife tells him, "Buy a gallon of milk, and if there are eggs, buy a dozen." So the programmer goes, buys everything, and drives back to his house. Upon arrival, his wife angrily asks him, "Why did you get 13 gallons of milk?" The programmer says, "There were eggs!"
 
The wife should have simply listed the items she wanted, one by one, as she obviously has a fool for a husband
 
Programmer is totally right next time wife needs to be specific ,"and if there are eggs, buy a dozen of eggs"
 
A programmer is going to the grocery store and his wife tells him, "Buy a gallon of milk, and if there are eggs, buy a dozen." So the programmer goes, buys everything, and drives back to his house. Upon arrival, his wife angrily asks him, "Why did you get 13 gallons of milk?" The programmer says, "There were eggs!"

1 gallon of milk and a dozen gallons of milk bcoz eggs were there, sio mkuu?
 
First thing ni kununua a single gallon of milk, lakin eggs zipo then statement of buying dozen of gallon will also be executed , so it will be 1+12=13✅
 
A programmer is going to the grocery store and his wife tells him, "Buy a gallon of milk, and if there are eggs, buy a dozen." So the programmer goes, buys everything, and drives back to his house. Upon arrival, his wife angrily asks him, "Why did you get 13 gallons of milk?" The programmer says, "There were eggs!"

The programmer had a rotten brain. He was instructed to buy a gallon of milk. After that he has to ask the grocery storekeeper whether the eggs are there or not. If they are there then he has to buy one dozen (12 eggs).
Or else the programmer may hqve understood differently due to umbiguity of the statement: that if eggs are available at home then he has to buy a dozen gallons of milk.
But still he was supposed to buy only 12 gallons of milk and not 13.
 
WHILE statement
A programmer is going to the grocery store and his wife tells him, while you're at the store, buy milk he never returned home.
 
Back
Top Bottom