Java program to find which department has highest placement program
import java.util.Scanner;public class Main{public static void main (String[] args){Scanner sc=new Scanner(System.in);System.out.println("Enter no of students placed in Computer science");int Computerscience= sc.nextInt();System.out.println("Enter no of students placed in Electronics");int Electronics=sc.nextInt();System.out.println("Enter no of students placed in Mechanical");int Mechanical=sc.nextInt();if(Computerscience<0||Electronics<0||Mechanical<0){System.out.println("Enter the number properly");}else if(Computerscience==Electronics && Electronics==Mechanical){System.out.println("None of the department has got the highest placement");}else if(Computerscience==Electronics && Mechanical<Computerscience){System.out.println("Highest placement");System.out.println("Computer science");System.out.println("Electronics");}else if(Computerscience==Mechanical && Electronics<Mechanical){System.out.println("Highest placement");System.out.println("Computer science");System.out.println("Mechanical");}else if(Electronics==Mechanical && Computerscience<Mechanical){System.out.println("Highest placement");System.out.println("Electronics");System.out.println("Mechanical");}else if(Computerscience>Electronics&&Computerscience>Mechanical){System.out.println("Highest placement");System.out.println("Computer science");}else if(Electronics>Computerscience && Electronics>Mechanical){System.out.println("Highest placement");System.out.println("Electronics");}else if(Mechanical>Computerscience && Mechanical>Electronics){System.out.println("Highest placement");System.out.println("Mechanical");}}}
Are there any code examples left?
New code examples in category Other
-
Other 2023-03-27 22:50:10 how to select the whole line in vscode with keyboard shortcut
-
Other 2022-03-27 22:45:24 income of a web developer
-
Other 2022-03-27 22:35:01 \pyrcc_main.py: File does not exist 'resources.qrc'
-
Other 2022-03-27 22:30:45 rick roll embed code
-
Other 2022-03-27 22:20:08 Circuit_04_Potentiometer
-
Other 2022-03-27 22:20:05 iterative power
-
Other 2022-03-27 22:15:11 flutter run all
-
Other 2022-03-27 22:10:05 when is karlson release
-
Other 2022-03-27 22:10:02 wp .htaccess example
-
Other 2022-03-27 22:00:08 bash pause in file read line by line