#include using namespace std; int main() { FILE* outfile; int speed = 1; outfile = fopen("my_speed.txt","w"); while(speed > 0) { cout<<"Enter the speed: \n"; cin>>speed; if(speed < 55) { fprintf(outfile, "%d is too slow\n\n", speed); } else if(speed < 71) { fprintf(outfile, "You're doing great at %d!\n\n", speed); } else { fprintf(outfile, "Slow down buddy, %d is way too fast!\n\n", speed); } } fclose(outfile); return 0; }