Compile error [closed]

-4

I just started AI and I do not get too much of it ... The idea was to use while to show us all even numbers up to 100 but it is always giving error and I have not been able to fix this yet.

while (i <= 100) {
   i += 1;
   if (i % 2 == 0)
       prinft('\n%d', i)
}
    
asked by anonymous 03.11.2016 / 16:27

2 answers

2

You entered wrong, not prinft, but printf.

You can use the module operator too ...

while (i <= 100) {
   i += 1;
   if (i % 2 == 0)
       printf('\n%d', i)
}
    
03.11.2016 / 16:34
0

You have written the name of the printf function erroneously.

The correct one is:

printf("Algum texto");

Try to pay more attention to the bugs that the compiler shows you. He is saying

  

"Undefined reference to prinft".

That is, either you typed it wrong or you did not include the correct libraries. In case, you had written wrong

    
03.11.2016 / 16:31