Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Write a description of class E1 here.
- *
- * @author Kailey McNeal
- * @version 10-24-14
- * p305 #1
- */
- public class E1
- {
- public static void main (String []args)
- {
- fractionSum(5);
- }
- public static void fractionSum(int n)
- {
- for (int i=1; i<=n; i++)
- {
- double div=(double)1/i;
- System.out.print(div);
- if(i<n)
- {
- System.out.print(" + ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement