Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C is hard -.-"

Name: Anonymous 2013-03-09 0:25



float ran();//Returns a float value in the range [0.0,2.0]

int main(int argc, char *argv[]){

  long double return_value=0.0;
  unsigned integer x,y=0;

  y-=1;

  for(x=0;x<y;x++)return_value+=ran();

  return_value/=y;


 return (int)return_value;


}


What are the chances of this program ending correctly?

Name: Anonymous 2013-03-09 8:05

y = -1;
for(x=0;x<y;x++) return_value += ran(); <- never executes

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List