please answer not for taking mark if u do like that u will be report
Answers
Program 1.
import java.util.Scanner; // We imported Scanner class
public class Main { // Class name is declared as "Main"
public static void main(String [] args) { // Main method
Scanner sc = new Scanner(System.in); //Activation of the Scanner
int principal = sc.nextInt(); // Getting input
int rate = sc.nextInt(); // Getting input
int time = sc.nextInt(); // Getting input
System.out.println("Simple interest is " + ((principal * rate * time) / 100)); // printing the output
}
}
Program 2.
import java.util.Scanner;// We imported Scanner class
public class Main { // Class name is declared as "Main"
public static void main(String [] args) { // Main method
Scanner sc = new Scanner(System.in); //Activation of the Scanner
int usin = sc.nextInt(); // Getting input
System.out.println("The last digit of the number is " + (usin % 10)); // Printing the output
}
}
Program 3.
import java.util.Scanner; // We imported Scanner class
public class Main { // Class name is declared as "Main"
public static void main(String [] args) { // Main method
Scanner sc = new Scanner(System.in); //Activation of the Scanner
int usin = sc.nextInt(); // Getting input
if (usin % 2 == 0) { // The if framework
Sytem.out.println("The given number is even."); // Printing the text
}
else { // The else framework
System.out.println("The given number is odd."); // Printing the text
}
}
}