Practice question
3 marksWrite a Java program segment to check whether a given integer n is prime.
Iterative ConstructsMediumApplication based
Computer Science · Class 11 · ISC
The for, while and do-while loops, entry- and exit-controlled loops, break and continue.
5questions
Syllabus mapping: ISC syllabus (CISCE) (opens CISCE's website in a new tab)
5 questions
Practice question
3 marksWrite a Java program segment to check whether a given integer n is prime.
Iterative ConstructsMediumApplication based
Practice question
3 marksWrite a Java program segment to find the sum of the first n natural numbers using a for loop.
Iterative ConstructsMediumApplication based
Practice question
3 marksState three differences between a while loop and a do-while loop.
Iterative ConstructsMediumShort answer
Practice question
3 marksDistinguish between the break and the continue statements.
Iterative ConstructsMediumShort answer
Practice question
3 marksHow many times does the body of this loop execute: for (int i = 10; i > 0; i -= 3) { … }
Iterative ConstructsMediumNumerical