Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SumOfDigitsExample2
- {
- public static void main(String arg[])
- {
- Scanner sc=new Scanner(System.in);
- //System.out.print("Enter a number: ");
- //reads a long number from the user
- int number1=Integer.parseInt(sc.nextLine());
- int number2=Integer.parseInt(sc.nextLine());
- int number3=Integer.parseInt(sc.nextLine());
- int number4=Integer.parseInt(sc.nextLine());
- int numberR=((number1+number2)/number3)*number4;
- //executes until the condition number!=0 becomes false
- //prints the result
- System.out.println(numberR);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement