Practice Syntax - 21.3.2 | 21. IF, FOR, WHILE | CBSE 9 AI (Artificial Intelligence)
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

Syntax

21.3.2 - Syntax

Enroll to start learning

You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

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

💡 Hint: What do you compare the number against?

Question 2 Easy

Create a FOR loop to print the first five letters of the alphabet.

💡 Hint: What string contains the letters?

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What does an IF statement do?

It performs a loop
It checks a condition
It assigns a value

💡 Hint: Think about how decisions are made in programming.

Question 2

True or False: A FOR loop can run forever.

True
False

💡 Hint: Consider how the iterations are controlled.

2 more questions available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Create a program that takes user input until a specific answer is given, implementing both IF and WHILE logic.

💡 Hint: What condition will let you exit the loop?

Challenge 2 Hard

Write a program that categorizes numbers into positive, negative, or zero using nested IF statements within a WHILE loop.

💡 Hint: What iterative method will keep asking for input until you break out?

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.