What will be the output of the following code C?
#include <stdio.h>
void solve(){
char ch[5] = "abcde";
int ans 0;
for(int i =0; i< 5; i++) {
ans += (ch[i] - 'a');
}
printf("%d", ans);
int main(){
solve();
return 0;
What is the out come of the following Arduino code?
void setup(){
Serial.begin(9600);
void setup0{
Serial.write(20);
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)
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
void solve0{
int b 4;
int res = b++ + ++b + ++b
printf("%d"', res);
What is the output of the following program?
for(;;)
{
Statemernts
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); }