If you have a light bulb and you want to be able to switch it on and
off, then you must connect the switch and the light bulb in series
across the battery.
If you connect the switch and light bulb in parallel across the battery,
then the light bulb will shine all the time, and PLUS ... when you flip the
switch to ' ON ', sparks will shoot out of the switch, the wires will get hot
and smoking, and the battery will instantly empty itself.
So this is an application where the series circuit might work better than
the parallel one.
Answer:
If a photo is too dark, it is underexposed. Details will be lost in the shadows and the darkest areas of the image. If a photo is too light, it is overexposed. Details will be lost in the highlights and the brightest parts of the image.
The already-long problem on hacking and other security-related cases necessitates for the application builders to check the data received from unknown sources. To further strengthen the security, even data received from known sources also need to be check as these may also contain harmful viruses creating critical problem to the application.
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.