• Kursy
  • Kompilator kodu
  • Dyskusja
  • Cennik
  • Zespoły
Menu

Dyskusje Q&A

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 głosów
5 odpowiedzi
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 głosów
2 odpowiedzi
9th Jul 2016, 12:20 PM
milada
milada - avatar
< Do tyłu12Dalej >
Popularne dzisiaj
Can I import any module in python in this app?
1 Votes
Loops and conditions
2 Votes
GitHub account connecting issue
3 Votes
Algorithm to create maze-like grid
2 Votes
photo upload issue in html code
0 Votes
app for lessons
1 Votes
Any coding competitions?
1 Votes
Alguém Português por aqui?
0 Votes
I can't figure out how to use the getElementById code in JavaScript Code Playground, I've tried multiple times and watched YT
0 Votes
Rise of AI
1 Votes