Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- System.out.println("Example 1:");
- double sales = 12345.67;
- System.out.printf("are sales are %f for the day.\n\n", sales);
- System.out.println("Example 2: ");
- double temp1 = 72.5, temp2 = 83.7;
- System.out.printf("The temperature are %f and %f degress\n\n", temp1, temp2);
- System.out.println("Example 3: ");
- double value1 = 3.0, value2 = 6.0, value3 = 9.0;
- System.out.printf("%f %f %f\n\n",value1, value2, value3);
- System.out.println("Example 4: ");
- int hours = 40;
- System.out.printf("I worked %d hours this week",hours);
- //%d for integers.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement