TOPUPchat logo...
Forgot password?

Select : C language | Java

Q.16] error with i

public class Test2 {
public static void main(String[] args) {
    int i = 1;
    for (; i <= 10; i++) {

    if (i > 7)
        break;
    }
    System.out.println(i);
}}
    

Options]

A)  7
B)  8   
C)  8 9 10   
D)  Compilation error at line no-4.        

Click to See Answer
B)  8       

Next | using break in main function

Previous | a drop of generics

Hemen Ashodia [paper setter]
Register & recharge
Male Female
I agree Terms and Conditions