Predict the output of the following code if the object is moving away from the sensor
int op = 7; int isBarrier = HIGH; void setup() { pinMode(op, INPUT); Serial.begin(9600); } void loop() { isBarrier = digitalRead(op); if (isBarrier == LOW) { Serial.println("1+"); } else { Serial.print("clear+"); } delay(100); }
What will be the output of the following code
#include <stdio.h> void solve(){ int b=4; int res = b++ + ++b + ++b; printf("%d", res); } int main(){ solve(); return 0; }
What is the output of the following program?
for(;;)
{
Statements
}
What is the objective of the code given below if it is executed on the Arduino Uno?
#include<EEPROM.h> int pin=13; void setup() { pinMode(pin,OUTPUT); Serial.begin(9600); { void loop() for(int i-0; i<EEPROM.length(); it+) { EEPROM.write(i, 1) digitalWrite(pin,HIGH; exit(0); }
for(;;) { Statements }
#include<EEPROM.h> int pin=13; void setup(){ pinMode(pin,OUTPUT); Serial.begin(9600); void loop(){ for(int i-0; i<EEPROM.length(); i++) { EEPROM.write(i, 1); digitalWrite(pin, HIGH); exit(0); }
Predict the output of the following code if the object is moving towards the sensor.
int op = 6; int isBarrier = HIGH; void setup() { pinMode(op, INPUT) Serial.begin(9600); } void loop(){ isBarrier = digitalRead(op); if (isBarrier == LOW) { Serial.println("1+"); } else{ Serial.print("clear+"); delay(100); }
What will be the output of the following code snippet?
d={3,4,5} for k in d: print(k)