Answer:
a)
#include <iostream>
using namespace std;
int main() {
bool a,b,c;
cin>>a>>b;
if(a^b)//X-OR operator in C++.
c=true;
else
c=false;
cout<<c;
return 0;
}
b)
#include <iostream>
using namespace std;
int main() {
bool a,b,c,d;
cin>>a>>b>>c;
if((a^b)^c)//X-OR operator in C++.
d=true;
else
d=false;
cout<<d;
return 0;
}
Explanation:
The above written programs are in C++.There is an operator (^) called X-OR operator in C++.It returns true if the number of 1's are odd and returns false if the number of 1's are even.
In the if statement I have user X-OR operator(^) to find the result and storing the result in another boolean variable in both the questions.
Answer:
scope
Explanation:
Destructor is a member function and it call automatically when the class object goes out of scope.
Out of scope means, the program exit, function end etc.
Destructor name must be same as class name and it has no return type.
syntax:
~class_name() { };
For example:
class xyz{
xyz(){
print(constructor);
}
~xyz(){
print(destructor);
}
}
int main(){
xyz num;
}//end program
when the object is create the constructor will called and when the program end destructor will call automatically.
Answer:
1. would be B.
2. would be D
3. May I ask if it can be multiple answers?
Explanation:
1. In coding a if statement has to follow if something is true or not. If we are talking about a if and then statement it will skip that block and move to the next block of the "then" part of the "if then" Statement if the first part is reported false
2. This is a easy one, so it has to be either a 3.25 GPA or higher or they have to have either 100 hours or more.
3. waiting for a comment back :)
They may invade privacy rights of air space and be used for other unintended acts such a bombings and espionage