Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Taschenrechner {
- public static int durrchscnitt(int a, int b, int c){
- int summ=a+b+c;
- return summ/3;
- }
- public static void main (String[] args){
- Scanner scan=new Scanner(System.in);
- System.out.println("Geben Sie bitte den ersten Zahl ein: ");
- int zahl1=scan.nextInt();
- System.out.println("Geben Sie bitte den zweiten Zahl ein: ");
- int zahl2=scan.nextInt();
- System.out.println("Geben Sie bitte den deritten Zahl ein: ");
- int zahl3=scan.nextInt();
- System.out.println("Der Durchschnitt ist: "+durrchscnitt(zahl1,zahl2,zahl3));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement