0% found this document useful (0 votes)
39 views3 pages

Write A Shell Script To Find Whether An Input Integer Is Even or Odd

The document outlines a series of tasks for writing shell scripts, including checking if a number is even or odd, finding the greatest among three numbers, calculating net salary with allowances and deductions, and implementing various mathematical operations. Additional tasks involve generating number series, checking for prime numbers, and performing file operations. The document serves as a comprehensive guide for practicing shell scripting skills.

Uploaded by

abhijitdas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views3 pages

Write A Shell Script To Find Whether An Input Integer Is Even or Odd

The document outlines a series of tasks for writing shell scripts, including checking if a number is even or odd, finding the greatest among three numbers, calculating net salary with allowances and deductions, and implementing various mathematical operations. Additional tasks involve generating number series, checking for prime numbers, and performing file operations. The document serves as a comprehensive guide for practicing shell scripting skills.

Uploaded by

abhijitdas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1. Write a shell script to find whether an input integer is even or odd.

2. Write a shell script to find out the greatest among three inputs
3. Write a shell script to calculate the net salary of an employee in a particular month
considering various allowances (TA, DA, HRA) and deductions (INCOME TAX, PROVIDEND
FUND) as:

a. TA=15 percent of basic salary

b. DA=2 percent of basic salary

c. HRA=10 percent of basic salary

d. INCOME TAX=5 percent of salary

e. PROVIDEND FUND=10 percent of salary

4 A departmental store announces its festival scheme to customers on cash payment.

The scheme is as follows-

a. If purchase amount is less than 1000 then Tax=2% and discount=10%.

b. If purchase amount is greater than 1000 then Tax=5 % and discount=20%

5. Write a shell script to perform an arithmetic operation upon two inputs. The operation should
also be input by the user

6. Write a shell script to concatenate files

7. Program for command-line parameter & special variable.

8 Write a shell script to find out the ny, where n and y must be input by the user.

9 Write a shell script to find out the factorial of an input.

10 Write a shell script to generate the series of even number from 0 to n. 0 2 4.....n

11 Write a shell script to check whether an input is a prime or not.

12 Write a shell script to generate the primes between two given numbers.

13 Write a shell script to find out the sum of series 1+2+3+………….n, where n is
input by the user.

14 Write a shell script to generate the series 1, 5, 2, 10, 3, 15,………….50


15. The XYZ construction company plans to give a 5% year-end bonus to each of its
employees earning Rs.

5,000 or more per year and a fixed bonus of Rs 250 to all other employees.

Print the bonus of any employee.

16 Write a shell script to compare two strings input by the user for equality.

17 Write a shell script to count the number of characters, words, spaces in a given text

18 Write a shell script to perform following tasks-

a. Display the present working directory.

b. Clear the screen.

c. Display the current date.

d. Make a directory with its -directory d1.

e. Change the directory to the directory having sub directory d1.

f. Create two files (say file1 & file2) within this.

g. Provide appropriate security options to these files.

h. List the contents of directory.

19 The marks obtained by a student in five different subjects are input through the
keyboard. The student gets a division as per the following rules. (Using else's clause).

if percentage greater than or equal to 60 get First division

if percentage greater than or equal to 50 or less than 60 get Second division

if percentage greater than or equal to 40 or less than 50 get Third division

if percentage less than 40 Fail

20 The marks obtained by a student in two different subjects are input through the
keyboard. The student gets a division as per the following rules. (Using elif clause).

if percentage greater than or equal to 60 get First division

if percentage greater than or equal to 50 or less than 60 get Second division


if percentage greater than or equal to 40 or less than 50 get Third division

if percentage less than 40 Fail

21 To find out the greatest and smallest element of an array

22 Program for Swapping of Two Numbers

23 Write a Program to check whether a number given by the user is zero, positive or
negative.

24 Program for checking the login id & password.

25 The length & breadth of a rectangle and radius of a circle are input through the
keyboard.

26 Write a program to calculate the area & perimeter of the rectangle, and the area &
circumference of the circle.

27 If a five digit number is input through the keyboard, write a program to calculate the
sum of its digits.

You might also like