[go: up one dir, main page]

0% found this document useful (0 votes)
3 views1 page

Assignment Section B

The document outlines a series of tasks for writing shell scripts, including determining if an integer is even or odd, generating prime numbers between two inputs, calculating the sum of a series, finding the greatest among multiple integers, reversing the digits of an integer, and evaluating student divisions based on percentage scores. Additionally, it includes a formula for calculating the area of a triangle given its sides and a task to compute the sum of digits of a five-digit number. Each task is designed to enhance programming skills in shell scripting.

Uploaded by

abhionline84
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)
3 views1 page

Assignment Section B

The document outlines a series of tasks for writing shell scripts, including determining if an integer is even or odd, generating prime numbers between two inputs, calculating the sum of a series, finding the greatest among multiple integers, reversing the digits of an integer, and evaluating student divisions based on percentage scores. Additionally, it includes a formula for calculating the area of a triangle given its sides and a task to compute the sum of digits of a five-digit number. Each task is designed to enhance programming skills in shell scripting.

Uploaded by

abhionline84
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/ 1

1.

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


2. Write a shell script to generate the primes between two given numbers.
3. Write a shell script to find out the sum of series 1+2+3+………….n, where n is input by the user
4. . Write a shell script to find out greatest among n input integers where n is to be input by the
user.
5. Write a shell script to read an integer and print its digits in reverse order

6. 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

7. If the sides of a triangle are denoted by a, b and c then area of the triangle is given by
8. area = Square root of (s(s-a)(s-b)(s-c))
9. where, s = (a+b+c)/2
10. If a five digit number is input through the keyboard, write a program to calculate the sum of its
digits

You might also like