• Cursussen
  • Code Compiler
  • Discussiëren
  • Prijzen
  • Teams
Menu

Q&A Discussies

Why is the output 17 ? (this is the array modul quiz(SoloLearn)) int result = 0; for (int i = 0; i < 5; i++){ if (i == 3) { result += 10; }else{ result += i; } } System.out.println (result);
java
0 Stemmen
5 Antwoorden
22nd Jul 2016, 9:41 AM
Peter Müller
Peter Müller - avatar
What is the output and why? public static int[] make (int n){ int[]a=new int [n]; a [i]=i+1; } return a; } public static void dub (int []jub){ for (intent i=0;i <jub.length;i++){ jub*=2; } } public static int mus (int []zoo){ int jus=0; for (int i=0;i <zoo.length;i++){ jus+=zoo [i]; } return jus; } public static void main (String [] args){ int [] bob =make(5); dub (bob); System.out.println (mus (bob)); }
java
0 Stemmen
2 Antwoorden
9th Jul 2016, 12:20 PM
milada
milada - avatar
< Vorige12Volgende >
Populair vandaag
What is a simple and easy way to learn ruby? :)
0 Votes
How do i make a lexer and parser
1 Votes
Help
1 Votes
Data analysis
0 Votes
Lesson Takeaways
0 Votes
If we already have the DELETE command in SQL, why do we need TRUNCATE?
2 Votes
Order of AI courses
0 Votes
I’m a beginner and looking to learn the basics
0 Votes
Saved code
0 Votes
Upvoting not work
0 Votes