Practice Declaration and Initialization - 2.2 | Chapter 10: Arrays and Strings | ICSE Class 12 Computer Science
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

What is the correct syntax to declare an array of 10 integers?

💡 Hint: Remember to specify the type and size.

Question 2

Easy

How do you initialize an array with values 1, 2, and 3?

💡 Hint: Use curly braces with values inside.

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 result of this declaration: int marks[5];?

  • An array of 5 integers
  • An array of strings
  • A single integer

💡 Hint: Count how many integers can be stored here.

Question 2

True or False: Strings in C++ must always end with a null character.

  • True
  • False

💡 Hint: Think about how the end of a name is specified in programming.

Solve 1 more question and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

Write a C++ program that declares an array, initializes it with values, and prints them using a loop.

💡 Hint: Think about how to set up your for loop.

Question 2

Explain the implications of not using the null terminator in a string declaration.

💡 Hint: Consider what happens when the program tries to determine the length of the string.

Challenge and get performance evaluation