After putting all the numbers input the loop terminates and the program ends, after asking whether to continue or not.
import java.util.Scanner;
public class coding {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner (System.in);
String choose;
int i;
double ans;
do {
int num1= in.nextInt();
int num2= in.nextInt();
int num3= in.nextInt();
int num4 = in.nextInt();
int num5 = in.nextInt();
ans = (num1+num2+num3+num4+num5)/5;
System.out.println(ans);
//in.nextLine();
System.out.println("Continue the program Yes or N?");
choose = in.nextLine();
}while (choose.equalsIgnoreCase("Yes"));
}