int main() { int min, val; min = INT_MAX; // Maximum value of int type constant
printf ("Enter an integer\nExit Ctrl+z\n");
while (scan("%d", &val)! = EOF) //Ctrl+z Enter to exit the repeat statement
{
if (val < min)
min = val;
}
printf ("minimum value is %d\n", min);
return 0;
}
//If you type Ctrl+z during execution, it will not exit. Help me.
c
If the operating system is unix/linux, the ctrl+z signal is the end of the process.
Loop termination must be made with different conditions.
© 2024 OneMinuteCode. All rights reserved.