Ask coding questions

← Back to all posts
Error
Pseudo4ngel

I dunno what to do in this case....;

#include <stdio.h>

int i = 0;
while(i < 50)
{
printf("Hello, world\n");
i++;
return 0;
}

Cuz, in the "while" line appears an error that I can't solve

Answered by KobeFF [earned 5 cycles]
View Answer
Voters
AtriDey
Pseudo4ngel
Comments
hotnewtop
KobeFF

@DrinpHen4 I fixed it... Try this:

I think you forgot the:

Please mark this answer correct if it was helpful in any way

Pseudo4ngel

@KobeFF Ty Kobe

KobeFF

@DrinpHen4 You're welcome... Also, mark me or @CodeLongAndPros correct so people know the this question has been answered.

CodeLongAndPros

@KobeFF is correct, you need to add:

and in the brackets, add your code that you want to run.
The reason the int i; does not error is that vars can be defined outside the main() function.

KobeFF

@CodeLongAndPros Definitely...

Pseudo4ngel