CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: NoFormat

No Title

79 Views
Copy Code Show/Hide Line Numbers
// Räknar ut medelvärdet av två tal.
//
//
//************************************************************
import java.text.DecimalFormat;
import java.util.Scanner;
 
public class Average
{
 
public static void main (String[] args)
    {
        int tal1, tal2;
        double Average;
        
        Scanner scan = new Scanner( System.in );
        
        System.out.println("Skriv in ett tal");
      tal1 = scan.nextInt();
        
        System.out.println("Skriv in ett tal");
      tal2 = scan.nextInt();
        
        Average = tal1 + tal2 / (tal1 + tal2);
        
       System.out.println("Medelvärdet av de två talen blir: " + Average);
    
    }
 
 
 
}
by Sara
  February 07, 2010 @ 9:23am

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate