aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Java Programming Fundamentals with C++ Concepts
  • What will be the output of following code? public class M...
Multiple choice technology programming languages

What will be the output of following code? public class Main { public static void main(String[] args) { int values[] = {1,2,3,4,5,6,7,8}; for(int i=0;i<8; ++i) System.out.println(values[i++]); } }

  1. 1 3 5 7

  2. 2 4 6 8

  3. 2 3 4 5 6 7 8

  4. None of above

Reveal answer Fill a bubble to check yourself
A Correct answer

Keep practicing — related questions

  • What will be the output of the below code snippet? public class Quiz4 { public static void main(String args...
  • What will be the output of the below code snippet? public class Quiz9 { public static void main(String args...
  • What will be the output of the program? class Test { public static void main(String [] args) { int x= 0; in...
  • What will be the output of the program? class Test { public static void main(String [] args) { int x= 0; in...
  • Given the following code, what will be the output? class Value { public int i = 15; } public class Test { p...
  • int values[] = {1,2,3,4,5,6,7,8}; for(int i=0;i< X; ++i) System.out.println(values[i]); Referring to the ab...
  • What will be the output of the below code snippet? public class Quiz2 { public static void main(String args...
  • What will be the output of the following code? import java.lang.*; public class One { public static void ma...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy