Advertisement
CR7CR7

IntegerOperations

Sep 23rd, 2022
745
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. import java.util.Scanner;  
  2. public class SumOfDigitsExample2  
  3. {  
  4. public static void main(String arg[])  
  5. {  
  6.  
  7. Scanner sc=new Scanner(System.in);  
  8. //System.out.print("Enter a number: ");  
  9. //reads a long number from the user  
  10. int number1=Integer.parseInt(sc.nextLine());  
  11. int number2=Integer.parseInt(sc.nextLine());
  12.   int number3=Integer.parseInt(sc.nextLine());
  13.   int number4=Integer.parseInt(sc.nextLine());
  14.   int numberR=((number1+number2)/number3)*number4;
  15. //executes until the condition number!=0 becomes false  
  16.  
  17. //prints the result  
  18. System.out.println(numberR);  
  19. }  
  20. }  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement