Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Sum10.java MrG 2013.1003
- purpose: using println to do arithmetic!
- required files: Sum10.java main class
- translator phase: javac Sum10.java
- interpreter phase: java Sum10
- */
- //main method
- public class Sum10
- {
- public static void main(String[] args)
- {
- System.out.print("1+2+3+4+5+6+7+8+9+10 = ");
- System.out.println(1+2+3+4+5+6+7+8+9+10);
- }
- }
- //C1X6: find the sum of the reciprocals of the first 10 positive integers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement