-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathRoundOff.java
More file actions
46 lines (29 loc) · 821 Bytes
/
RoundOff.java
File metadata and controls
46 lines (29 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package Problem_Statement;
import java.util.Scanner;
public class RoundOff {
public static int round10(int temp){
int sol;
if(temp%10<5)
sol=temp - (temp%10);
else
sol=temp+(10-(temp%10));
return sol;
}
public static void roundSum(int A, int B, int C){
int sum;
sum=round10(A) + round10(B) + round10(C);
System.out.println(sum);
}
public static void main(String[] args) {
Scanner s1 = new Scanner(System.in);
int A, B, C;
System.out.print("Enter value of A : ");
A=s1.nextInt();
System.out.print("Enter value of B : ");
B=s1.nextInt();
System.out.print("Enter value of C : ");
C=s1.nextInt();
roundSum(A, B, C);
s1.close();
}
}