Welcome

KU PRACTICAL 16 SETS 4TH SEM EXAM QUESTION WITH SOLUTIONS

SET 1
#1. Write a program to print “Welcome to Java Programming” on the screen.
class welcome
{
public static void main(String a[])
{
System.out.println("Welcome to Java Progamming");
}
}


#2. Using a case statement, write a shell program to read a command (eg., who, cal, ls, ps) from the user and execute it.
echo “Enter any command:”
read com
case $com in
who ) who;;
cal) cal;;
ls) ls;;
ps) ps;;
*) echo “Invalid command”
Esac