I'm beginning with C
I want to change while to for
int test(int nb){
int rv = 0;
if(nb=1)
return (1)
while(rv < nb) { // change this line
if(rv * rv == nb)
return (rv)
rv++;
}
return (0);
}
Can I do :
for (int rv=0; rv<nb.length; rv++)
Thanks for your help
You probably want this:
But I'm not sure if your original codes is correct in the first place.