• Cours
  • Compilateur de code
  • Discuter
  • Tarification
  • Équipes
Menu

Discussions Q&R

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 Vote
5 Réponses
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 Vote
2 Réponses
9th Jul 2016, 12:20 PM
milada
milada - avatar
< Précédent12Suivant >
Aujourd'hui en vedette
Is anyone else experiencing this Sololearn issue?
0 Votes
Best language?
0 Votes
solo learn program issue - iPhone?
1 Votes
How do I keep myself motivated in coding
0 Votes
you con help mi
1 Votes
Bro can you fix yt error?
0 Votes
Learn - multiple choice course questions display in one box making it impossible to continue
1 Votes
Anyone have song names? Comment your favorites here for a project im working on
0 Votes
Sql practice
0 Votes
I want to know how to make an Payment App like what I need to learn I need some guidance
0 Votes