Practice What is the IF Statement? - 21.1.1 | 21. IF, FOR, WHILE | CBSE Class 9 AI (Artificial Intelligence)
K12 Students

Academics

AI-Powered learning for Grades 8–12, aligned with major Indian and international curricula.

Professionals

Professional Courses

Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.

Games

Interactive Games

Fun, engaging games to boost memory, math fluency, typing speed, and English skills—perfect for learners of all ages.

Practice Questions

Test your understanding with targeted questions related to the topic.

Question 1

Easy

Write an IF statement to check if a number is positive.

💡 Hint: Think about how to compare the number with zero.

Question 2

Easy

Provide the ELSE part to notify if the number is not positive.

💡 Hint: Consider what needs to happen when the condition is false.

Practice 4 more questions and get performance evaluation

Interactive Quizzes

Engage in quick quizzes to reinforce what you've learned and check your comprehension.

Question 1

What is the main purpose of the IF statement in programming?

  • To perform loops
  • To make decisions
  • To handle errors

💡 Hint: Think about the condition it checks.

Question 2

True or False: The ELSE statement is optional in an IF structure.

  • True
  • False

💡 Hint: Consider whether it's possible to have only an IF statement.

Solve 2 more questions and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

Create a program that accepts user input and checks if the input number is both even and greater than 10. Provide appropriate messages for each scenario.

💡 Hint: Think about using nested IF statements for the conditions.

Question 2

Develop an IF-ELIF-ELSE application where the program can grade students based on their activity participation during a course. Assume participation scores are out of 100.

💡 Hint: Remember to define the function first, and then use conditions to categorize the score.

Challenge and get performance evaluation