Question

In: Computer Science

What is evaluated first in a compound condition in an IF statement ? not or and...

What is evaluated first in a compound condition in an IF statement ?

not

or

and

==

Solutions

Expert Solution

1) NOT (!)

2) == (equility)

3) AND (&&)

4) OR (||)

#include <iostream>

using namespace std;

int main() {

bool b1=true;

bool b2=false;

bool b3=false;

bool b4 =false;

if(!b1==b3 && b4 || b2 ){

cout<<"true"<<endl;;

}else{

cout<<"false"<<endl;

}

bool b8=false;

bool b5=true;

bool b6=false;

bool b7 =false;

if(!b8&&b5 ==b6 || !b7 ){

cout<<"true";

}else{

cout<<"false";

}

}


Related Solutions

1- Who is the inventor of air condition, and what year was the first modern air...
1- Who is the inventor of air condition, and what year was the first modern air conditioning produced? 2- Explain the the Combined Gas Law and 2nd law of thermodynamics briefly. 3- Explain the Air Conditioning Cycle in steps and use figure? 4- Describe the role of each part of the A/C system including: Compressor, Condenser ,Expansion valve and Evaporator. 5- What are the types of A/C? 6- Explain the working principle of Water Cooled Chiller and Air Cooled Chiller...
1.What is the First Condition of Equilibrium? 2.Explain what Pythagorean Theorem is and give the formula....
1.What is the First Condition of Equilibrium? 2.Explain what Pythagorean Theorem is and give the formula. ? 3.The Scalar Product or otherwise known Dot Product of two vectors is the sum of the products of their respective components. What does the scalar product give us? And when is the product zero?
For the compound, Niacin What are the safety hazards of the compound?  
For the compound, Niacin What are the safety hazards of the compound?  
Please write at least 150 words on the following: Under what condition the first-mover advantage could...
Please write at least 150 words on the following: Under what condition the first-mover advantage could be a particularly important factor (consider the concepts such as Increasing return, Marginal cost, Network effect, Lock In effect, bulk processing industry, knowledge industry etc.)?
1. Two new issue bonds are being evaluated by a portfolio manager. The first bond is...
1. Two new issue bonds are being evaluated by a portfolio manager. The first bond is a 5-year 3.8% semiannual coupon and the second bond is a 20-year 4.4% semiannual coupon. Both bonds are expected to be issued at par. a. Calculate the modified duration for each bond using a 10bp change b. Calculate the convexity for each bond using a 10bp change. Someone help please!
Given the following pre-condition and program segment, what is the post-condition for y? // Pre-condition: -2...
Given the following pre-condition and program segment, what is the post-condition for y? // Pre-condition: -2 <= x < 4 y = 2*x*x - x +3
What is the pre-condition for x, if the post-condition is -30 <= y <= 0 for...
What is the pre-condition for x, if the post-condition is -30 <= y <= 0 for the following program segment? y = x * x - 5 *x - 24
under what condition is erythroblastosis fetalis? why is the condition given this name?
under what condition is erythroblastosis fetalis? why is the condition given this name?
Why does a race condition occur? What is the solution for the race condition?
Why does a race condition occur? What is the solution for the race condition?
What is the nuclear condition of the basidiospores?
What is the nuclear condition of the basidiospores?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT