Fill in the missing lines of code so that the program accepts three integers separated by a delimiter and adds the first two integers and divides that sum by the third integer. Example Input/Output 1: Input: 54 : 6 : 30 Output: 2
The code is as follows:
Answers
Answer:
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
sc.next();
int B = sc.nextInt();
sc.next();
int C = sc.nextInt();
System.out.println((A+B)/C);
}
}
Explanation:
you can find this in skillrack sc.next() desolves the delimiter so that we will get only the integers as output.
The given question is that we have to write a
program accepts three integers separated by a delimiter and adds the first two integers and divides that sum by the third integer.
let us write a program
Input Numbers= input("Enter 3 integers separated by a delimeter")
elm= input N. split(":")
ans=elm[0]+elm[1]/elm[2]
print(ans)
Therefore, the output of the given program is the addition of two input is divided by the third input.
#spj2
https://brainly.in/question/32584999?referrer=searchResults