Android Error

The series returns again! This time with color code formatting! (Thanks to the Brilliant Team)

Alex is wondering how to build an android robot that can do Mathfights for him. He is currently stuck on one part of the phase, though:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
//Written in C
//Here is the bootloader....
printf("Booting up...");
int state = getAndroidState();   //gets current android state, this is a real function that returns an integer, whatever that means.
if (state == 0){     //means ok
    printf("Booted up correctly. My name is Alex number 2.");
}
else //this means that it has boot problems{
    printf("Uh oh...");
}

What was his error? Input the number from the chart below:

1No errors.
2No such function 'printf'
3Comment placement incorrect
4Forgotten Semicolon
5Parse error: type 'int' cannot be explicitly casted as type 'char'
6Parse error: type 'char' cannot be explicitly casted as type 'int'
7Parse error: type 'int' cannot be implicitly casted as type 'char'
8Parse error: type 'char' cannot be implicitly casted as type 'int'
9I give up.

** Image credit: Flickr user D J

×

Problem Loading...

Note Loading...

Set Loading...