Report Bug

Qus

What is the output of “pin 1” if “pin2” is sent “1011” where 1 is 5V and 0 is 0V?

int pin1 = 12;
int pin2 = 11;
void setup() {
   pinMode(pin1, OUTPUT);
   pinMode(pin2, INPUT);
   Serial.begin(9600);
}
void loop() {
  if(digitalRead(pin2)==1) {
	 digitalWrite(pin1,LOW);
	  }
else if(digitalRead(pin2)==0) {
digitalWrite(pin1,HIGH);
}
}
Qus

"पिन 1" का आउटपुट क्या है यदि "पिन2" को "1011" भेजा जाता है जहां 1 5V है और 0 0V है?

int pin1 = 12;
int pin2 = 11;
void setup() {
   pinMode(pin1, OUTPUT);
   pinMode(pin2, INPUT);
   Serial.begin(9600);
}
void loop() {
  if(digitalRead(pin2)==1) {
	 digitalWrite(pin1,LOW);
	  }
else if(digitalRead(pin2)==0) {
digitalWrite(pin1,HIGH);
}
}


A. 1110
B. 0100
C. 1111
D. 1011


Solution
B. 0100



Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad