fork download
  1. import java.util.*;
  2.  
  3.  
  4. /* Name of the class has to be "Main" only if the class is public. */
  5. class Ideone
  6. {
  7. public static void main (String[] args)
  8. {
  9. Scanner sc=new Scanner(System.in);
  10. double q,w,e,r,t,y,u,s;
  11. System.out.println("Enter the total marks");
  12. u=sc.nextDouble();
  13. System.out.println ("enter the marks of 6 subject");
  14. q=sc.nextDouble();
  15. w=sc.nextDouble();
  16. e=sc.nextDouble();
  17. r=sc.nextDouble();
  18. t=sc.nextDouble();
  19. y=sc.nextDouble();
  20. s=(y+q+w+e+r+t)*100/u;
  21. System.out.println("per"+s);
  22. }
  23. }
Success #stdin #stdout 0.2s 60880KB
stdin
600
99
98
99
97
99
90
stdout
Enter the total marks
enter the marks of 6 subject
per97.0