I hav to write a simple program in bluej that computes and prints the sum of the reciprocals of the first 10 positive integers. My code is
public static void main (String[] args){
System.out.println(1/1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6 + 1/7 + 1/8 + 1/9 +1/10); }
It outputs the number 1. Can someone please explain why and tell me what the code should be? My teacher said I shouldn’t use variables or anything.