Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
Write an if statement that prints 'High score' if score > 100.
Remember the structure of an if statement.
Create an if-else statement that prints 'Adult' if age > 18, otherwise 'Minor'.
What will be printed if age is 18 or less?
What does the if statement do?
Think about under what circumstances will the code run.
Which loop guarantees at least one execution of its code block?
Consider the structure of each loop type.
Write a program that takes a student's marks and prints 'Excellent' for marks above 80, 'Good' for 60 to 80, 'Satisfactory' for 40 to 60, and 'Failed' below 40 using switch-case.
Remember to divide marks by 10 to categorize them into ranges.
Create a program using a while loop that reads and sums numbers until the user enters 0, then prints the total sum.
You’ll need to initialize your sum value before starting the loop.
5 more questions in this section. Enroll free to practise them all.
Enroll free