Created
October 3, 2017 20:35
-
-
Save viveknarang/351aeae662418c15908509237713c18f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class PrintWithComma { | |
public static void main (String [] args) { | |
final int NUM_VALS = 4; | |
int[] hourlyTemp = new int[NUM_VALS]; | |
int i; | |
hourlyTemp[0] = 90; | |
hourlyTemp[1] = 92; | |
hourlyTemp[2] = 94; | |
hourlyTemp[3] = 95; | |
/* Your solution goes here */ | |
for (i = 0; i < NUM_VALS; i++) { | |
System.out.print(hourlyTemp[i]); | |
if (i < NUM_VALS - 1) { | |
System.out.print(", "); | |
} | |
} | |
System.out.println(""); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment