Lab Activity 5
Subject : BIC 10204 : S4
Title : Lab Activity 5
Date / Day :
Name : Muhammad Faris Bin Yazid ( AI180079)
Harith Iskandar Bin Saiful Fahme (AI180106)
Lecturer : Dr. Pn. Hanayanti Binti Hafit
a.
i. y=m*x+c;
ii.
((2*a)/b)*3*c;
iii. 9*p+2*q*(r+2)/(2(s-1));
iv. ((3*e-d)/(x-9))-((4-3*c*c*c)/(4*y))
b .
c. [num1 = 26 ]
i. num2 = num1++ - 2;
= 26 – 2
= 24
ii. num2 = num1;
=
26
iii. num2 = ++num1 – 3;
= 27 – 3
= 24
iv. num2 = num1 -- + 1;
= 26 + 1;
= 27
d. [
i = 3 and j = 4 ]
i. k = j++;
= 4
ii. k = ++j;
= 5
iii. k = ++i * j--;
= 4 * 4
= 16
iv. k = j++ * -- i;
= 4 * 2
= 8
v. k = j * i/j -- ;
= 4 * 3 / 4
= 3
vi. k = 24/j++ - 16 % i;
= 24 / 4 – 16 % 3
= 6 – 16 % 3
= 6 – 1
= 5
e.
1: 10
2: 10
3: 11
4: 12
5: 12
6: 31
7: -11
8: 33
9: 33
10: 33
11: 0
12: 1
13: 0
i. 7
printf ("\n%d", i + j );
ii. 8
printf ( "\n%d" , ++i + j);
iii. 9
printf ("\n%d" , ++i + ++j);
iv. 12
printf ("\n%d" , i * ++j);
v. 36
x = pow (++j, i);
printf ("\n%d", pow);
Comments
Post a Comment