Loops: Part 2

For loop When we know about the terminating condition, but we don't know how many times the  loop will execute, we use while loop. But at times we just want our code to run a fixed number of times, no matter what is in the statements, then for loop is used. The syntax of a … Continue reading Loops: Part 2

Conditionals

You have learned about getting inputs and displaying outputs but their are certain cases where we want to execute program according to the given input. For example: A vegetable vendor is left only with spinach. Now if any one asks for spinach he will say Yes, if any other vegetable is asked for he will … Continue reading Conditionals