For Loop Practical

Advertisements
Advertisements
Advertisements3
Advertisements4
Advertisements6
Advertisements66

 1. What is the output of the following code?

int i = 0;
for(i = 0 ; i < 5; i++){         
}       
System.out.println(i);

Ans. 5.

2. What is the output of the following code?

public class Test{

     public static void main(String []args){
        int i = 0;
        for(i = 0; i < 10; i++){
            break;
        }
        System.out.println(i);  
     }
}

Ans. 0. 

Author: Lakshmi Prasanna Ponnala

Completed M.Tech in Digital Electronics and Communication Systems.

Leave a Reply

error: Content is protected !!

Discover more from ece4uplp

Subscribe now to keep reading and get access to the full archive.

Continue reading