Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Name: Abhishek Mandal

Roll No: DC2022MCA0011


OS LAB ASSIGNMENT 3

1. Write a shell script to create an array and store the elements as given below:

22 -9 67 32 0 -9 -7 0 23 0

• Count the no. of Positive, Negative and Zero in the array.


• Find the sum of all positive numbers.
• Replace all zero’s by negative numbers & all -9 by zero’s.
2. Write a shell script to create an array ‘NAME’ and store the elements as given below:

Abhishek Jesika Niresh Aditya Bhargav Nandini Sbuntimary Harlongbi Rosemerry Jessica

• Find the length of each name.


• Display all the names whose length is 6.
• Find the name which is the longest.
• Change all the names to uppercase.

You might also like