Sie sind auf Seite 1von 1

CAD Lab Workshop

Tutorial 1 on C

1. Convert following equations into corresponding C statements. Ask the


inputs from user in each case and return the output.

(a) Z = abc + bca


a+c
(b) Z = c
b+ a+d

(c) Z = (cos x)4 + loge |a + ib| where i = 1

2. Write a C programme which ask marks obtained in 5 subjects by a


student out of 100. It will output percentage marks obtained by the
student.

3. A cashier has currency notes of denominations 10, 50 and 100. If the


amount to be withdrawn (multiple of 10) is input through the key-
board, find the total number of currency notes of each denomination,
the cashier will have to give to the withdrawer.

4. If population of a city become 1.5 times in one year and its present
population is 1,20,000 what will be the population after 10 years? Write
a C programme to evaluate it.
R5
5. Integrate 2 x2 dx using 3 point gauss quadrature rule. First you have
to transfer the integration limit with suitable substitution, from -1 to
1 in order to use the following table 1, then you have to integrate.

Gauss Points Weights


-0.77459667 5/9
0.77459667 5/9
0 8/9

Table 1: Three point gauss quadrature rule to integrate from -1 to 1

Das könnte Ihnen auch gefallen