-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday 9
More file actions
22 lines (19 loc) · 646 Bytes
/
day 9
File metadata and controls
22 lines (19 loc) · 646 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//Write program in java that input by the user take 3 intergers then calculate their sum and average with suitable message
import java.util.Scanner;
class htmlkichot
{
void display()
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter first integer: ");
int num1 = sc.nextInt();
System.out.print("Enter second integer: ");
int num2 = sc.nextInt();
System.out.print("Enter third integer: ");
int num3 = sc.nextInt();
int sum = num1 + num2 + num3;
double average = sum / 3.0;
System.out.println("Sum: " + sum);
System.out.println("Average: " + average);
}
}