You can have more than one return in a function. Since this is main(), you may wish, instead, to consider an exit function, instead.
There should be no reason, however, that you cannot use:
if (onevalue()==1) {
printf ("Error")
return;
}
or, wrap the whole thing up as:
void main() {
if (onevalue()==1) {
printf ("Error")
}
else {
for (int i = 0; i<3; i++)
printf ("here :%d \n" , i);
}
return;
}