Page 67 - CITS - CSA - TP (Volume 2) - Hindi
P. 67
कं ूटर सॉ वेयर ए ीके शन - CITS
टा 2: लूप म continue का उपयोग करना
public class ContinueExample {
public static void main(String[] args) {
// This program prints even numbers in a loop, skipping odd numbers
// Print even numbers in a loop
for (int i = 1; i <= 10; i++) {
if (i % 2 != 0) {
// Skip odd numbers and continue to the next iteration
continue;
}
System.out.println(“Even number: “ + i);
}
}
}
आउटपुट:
53
CITS : IT & ITES - कं ूटर सॉ वेयर ए ीके शन - अ ास 89

