Declare a float representing the number of miles traveled fo
Solution
6) float trip_miles;
7) const double pi = 3.14 ;
8) double sqrt_number(double number);
9) 60; beause first 30/2 = 15 is evaluated. Then 15* 3 =45 is calculated. Then 45+20 =65 is calculate.
At last 65-5 = 60, Ans.
10) Given a=1 , b= 0
1) a && b ; ----------> false //&& means logical and operation. it gives true only if both operands are true.
2) a || b ;--------------------> true // || is logical OR operation which gives true if any one of the operands is true
3)!a || b; ---------------------> false // || is gives false if both operands are false. !a meas NOT a ie it evaluates with a=0
4)a>=b && !(!b)) ---------> false // !(!b) evaluates as b=0 ie first notes evaluate b as 1 but the second not makes it as 0. a>= b is true. But for && gives true only if both operands are true. since !(!b) is false the result is false.
5) !a || !b == !(a && b) -----> true. !(a &&b) evaluates as true. !b is also evaluated as true.
therefore !b == !(a && b) is true. !a evaluated as false. But for OR operator(||) gives one if any one of the operand is true. Therefore the ans is true.
