You are on page 1of 4

Exercise 1

To write a Scilab code to find the solution of the following problems:


1. Evaluate:

(i) 271 /3 + 320.2

Code -> (27) ^ (1/3) + (32) ^ (0.2)

Ans = 5.

(ii) √ 64+ e 4

Code -> sqrt (64) + exp (4)

Ans = 62.598150
π
(iii) sin 6 + cos 60 °

Code -> sin (%pi/6) + cosd (60)

Ans = 1.

(iv) 4! + ln2+ log100

Code -> factorial (4) + log (2) + log10 (100)

Ans = 26.693147

(v) (2+3i) (4+5i)

Code -> (2+3*(%i))*(4+5*(%i))

Ans = -7. + 22.i

Name- Harsh Bana

Admission no.- 22SCSE1010640


2. By assigning values 2 and 5 to variable a and b respectively,
Compute:

(i) c = (a+ b)2

Code -> a=2, b=5

a =2.

b =5.

Code -> c= (a+b) ^2

Ans => c = 49.

(ii) d =4a-3b+ln (a) +c 2

Code -> d = (4*a-3*b + log (a) + c^2)

Ans => d = 2394.6931

Name- Harsh Bana

Admission no.-22SCSE1010640
Exercises 2
Compute:

(i) 7+8/2

Code -> 7+(8/2)

Ans = 11.

(ii) (7+8)/2

Code -> (7+8)/2

Ans =7.5

(iii) (4+ 2*5)/7

Code -> (4+2*5)/7

Ans =2.

(iv) 271 /3 + 320.2

Code -> (27) ^ (1/3) + (32) ^ (0.2)

Ans = 5.

Name- Harsh Bana

Admission no.- 22SCSE1010640

You might also like