Computer Applications
Give two differences between 'Break' and 'Continue'.
Java Nested for Loops
19 Likes
Answer
| break | continue | 
|---|---|
| It is used to unconditionally jump out of the loop | It is used to unconditionally jump to the next iteration of the loop, skipping the remaining statements of the current iteration. | 
| It is used in switch-case and loops | It is only used in loops. | 
Answered By
10 Likes
Related Questions
- Write a program in Java to display the following pattern: - 1 
 2 3
 4 5 6
 7 8 9 10
 11 12 13 14 15
- Write a program to generate a triangle or an inverted triangle till n terms based upon the user's choice. - Example 1: 
 Input: Type 1 for a triangle and
 Type 2 for an inverted triangle
 Enter your choice 1
 Enter the number of terms 5
 Sample Output:
 1
 2 2
 3 3 3
 4 4 4 4
 5 5 5 5 5- Example 2: 
 Input: Type 1 for a triangle and
 Type 2 for an inverted triangle
 Enter your choice 2
 Enter the number of terms 6
 Sample Output:
 6 6 6 6 6 6
 5 5 5 5 5
 4 4 4 4
 3 3 3
 2 2
 1
- Using the switch statement, write a menu driven program for the following: - (a) To print the Floyd's triangle: 
 1
 2 3
 4 5 6
 7 8 9 10
 11 12 13 14 15- (b) To display the following pattern: 
 I
 I C
 I C S
 I C S E- For an incorrect option, an appropriate error message should be displayed. 
- Using the switch case statement, write a menu driven program for the following: - (a) To input a number and display only those factors of the numbers which are prime. 
 Sample Input: 84
 Sample Output: 2, 3, 7- (b) A program that displays the multiplication table from 1 to 10, as shown: 
 1 2 3 4 5 6 7 8 9 10
 2 4 6 8 10 12 14 16 18 20
 3 6 9 12 15 18 21 24 27 30
 ……………………………..
 ……………………………..
 ……………………………..
 9 18 27 36 45 54 63 72 81 90
 10 20 30 40 50 60 70 80 90 100