Write shell script for:
Given two integers, X and Y , find their sum, difference, product, and quotient.
Input Format
Two lines containing one integer each (X and Y respectively).
Constraints
-100 < X,Y< 100
Y != 0
Output Format
Four lines containing the sum (X+Y), difference (X-Y), product (X * Y), and quotient (X/Y), respectively.
(While computing the quotient, print only the integer part.)
Answers
Answer:
As a UNIX user, you have a wide variety of shells available to you: the Bourne shell, Bourne Again shell, POSIX shell, C shell, TC shell, Z shell, and Korn shell. Although this is not an all encompassing list of available shells, it does cover the more commonly used shells. Most UNIX systems come pre-installed with some subset of the shells mentioned. If you wish to use a shell that was not pre-installed on your system, you will more than likely find the one you want on the Internet. The C shell--the subject of this chapter--is one of the more popular and widely available shells in UNIX. It was developed after the Bourne shell but before the Korn shell. The C shell incorporates many features of the Bourne shell and adds many new ones that make your UNIX sessions more efficient and convenient.
Each shell has certain advantages and disadvantages. You might want to review Chapter 13, "Shell Comparison," to help you decide which one to use.
The C shell, written by Bill Joy (also the author of the vi text editor), was not patterned after the Bourne shell. Bill chose the C programming language as a syntax model. The C shell commands--especially if, while, and the other structured programming statements--are somewhat similar in syntax to the equivalent statements in C. A shell is quite a different animal from a compiler, though, so the C programming language served only as a model; many forms and structures in the C shell have nothing to do with the C programming language.
Because the C shell is not just an extension of the Bourne shell syntax, this chapter will cover all aspects of C shell operation. You therefore can read it independently of Chapter 9, "The Bourne Shell," Chapter 10, "The Bourne Again Shell,"