Professional Documents
Culture Documents
Unix Assignment
Unix Assignment
Unix Assignment
Assignment - 1
Q1.) Create a script to check whether two numbers are equal or not.
Answer:
Q2.)Create a shell script to accept two numbers and find the greater
number.
Answer:
Q3.) Create a shell script to accept name and age and check whether
they are eligible for voting or not.
Answer:
Answer:
Q5.) Accept an integer as input and print the time of the day.
NIGHT,MORNING,AFTERNOON,EVENING,
INVALID.
Answer:
Q6.)You have some gold coins with you. You wish to divide this
among three of your
(3) You should not have any coins with you at the end of this sharing
process. The input has four lines. The first line contains the number of
coins with you. The next three lines will have the share given to your
three friends. If the division satisfies these conditions, then print FAIR.
If not, print UNFAIR.
Answer:
Q7.) Take three integer numbers as input. Check whether the given
numbers make
three sides of a triangle or not. [Hint 1: check whether they satisfy the
pythagorean
Answer:
Q8.) Accept a point in an x-y graph as input and find the place that
this point belongs to.
The input has 2 lines: the first line is the x-coordinate while the
second line is the
Answer:
Q9.) Write a shell script that accepts a positive integer n as input and
prints the first n
positive integers.
Answer:
Q10.) Accept a positive integer n as input and print all the factors of n.
Answer:
Answer:
Q12.) Accept a positive integer n as input and print the sum of all
prime numbers in the range [1,print 0.]
Answer: