0% found this document useful (0 votes)
2 views

Linux_Assignment3

The document outlines a series of assignments requiring the creation of Shell Scripts for various tasks, including finding maximum values, checking number properties, and displaying natural numbers. Each task specifies expected outputs and test data to guide the implementation. The assignments cover a range of programming concepts suitable for practicing Shell scripting skills.

Uploaded by

dbda.iacsdakurdi
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)
2 views

Linux_Assignment3

The document outlines a series of assignments requiring the creation of Shell Scripts for various tasks, including finding maximum values, checking number properties, and displaying natural numbers. Each task specifies expected outputs and test data to guide the implementation. The assignments cover a range of programming concepts suitable for practicing Shell scripting skills.

Uploaded by

dbda.iacsdakurdi
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/ 2

Assignment-3

1. Write a Shell Script to find maximum between two numbers.


2. Write a Shell Script to find maximum between three numbers.
3. Write a Shell Script to check whether a number is negative, positive or zero.
4. Write a Shell Script to check whether a number is divisible by 5 and 11 or not.
5. Write a Shell Script to check whether a number is even or odd.
6. Write a Shell Script to check whether a year is leap year or not.
7. Write shell script to check eligibility of candidate for voter id card
8. Shell Script to display the first 10 natural numbers.
Expected Output :
1 2 3 4 5 6 7 8 9 10

9. Shell Script to compute the sum of the first 10 natural numbers.


Expected Output :
The first 10 natural number is :
1 2 3 4 5 6 7 8 9 10
The Sum is : 55

10. Shell Script to display n terms of natural numbers and their sum.
Test Data : 7
Expected Output :
The first 7 natural number is :
1234567
The Sum of Natural Number upto 7 terms : 28

11. Shell Script to read 10 numbers from the keyboard and find their sum and average.
Test Data :
Input the 10 numbers :
Number-1 :2
...
Number-10 :2
Expected Output :
The sum of 10 no is : 55
The Average is : 5.500000

12. Shell Script to display the cube of the number up to an integer.


Test Data :
Input number of terms : 5
Expected Output :
Number is : 1 and cube of the 1 is :1
Number is : 2 and cube of the 2 is :8
Number is : 3 and cube of the 3 is :27
Number is : 4 and cube of the 4 is :64
Number is : 5 and cube of the 5 is :125
13. Shell Script to display the multiplication table for a given integer.
Test Data :
Input the number (Table to be calculated) : 15
Expected Output :
15 X 1 = 15
...
...
15 X 10 = 150

14. Shell Script to display the multiplier table vertically from 1 to n.


Test Data :
Input upto the table number starting from 1 : 8
Expected Output :
Multiplication table from 1 to 8
1x1 = 1, 2x1 = 2, 3x1 = 3, 4x1 = 4, 5x1 = 5, 6x1 = 6, 7x1 = 7, 8x1 = 8
...
1x10 = 10, 2x10 = 20, 3x10 = 30, 4x10 = 40, 5x10 = 50, 6x10 = 60, 7x10 = 70, 8x10 = 80

15. Shell Script to display the n terms of odd natural numbers and their sum.
Test Data
Input number of terms : 10
Expected Output :
The odd numbers are :1 3 5 7 9 11 13 15 17 19
The Sum of odd Natural Number upto 10 terms : 100

You might also like