0

can someone help me and tell me what is wrong, I can't figure it out. It is pointing to the line "public class Lab4.24"

import java.util.Scanner;

public class Lab4.24
  {
  public static void main(String[] args) {

  int i; float sum;
  i=3;
  sum=0;
  while(i<=99)
  {
  sum=sum + ( (i-2)/i);
  i=i+2;
  }
  printf(" sum %f\n", sum);
 }
}

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by JeffGrigg
1

You can't have a dot (.) in your class name. Remove it or use underscore (_) instead.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.