Uploaded by Chintan Bhatt

03May2023 Questions

advertisement
Odd Numbered Students
1. Write a shell script to generate the following pattern.
2. Write a shell script to find the first 07 prime numbers. Add those numbers and print
the answer in “sum” variable (e.g., 24). Later, reverse the value of “sum” (e.g., 42) and
display the division of individual digits of “sum” variable (e.g., 4/2=2).
Even Numbered Students
1. Write a shell script to generate the following pattern (e.g., Triangle) for “n”, where
“n” is user defined.
2. Write a shell script to read 10 numbers from a file (e.g., temp.txt) stored in a local disk
and make the sum of those numbers and store the sum in an another file (e.g.,
answer.txt) on a local disk. (Note: Manually create a file temp.txt in local disk and enter
10 numbers in it).
Download