阅读背景:

Why does my C program do not jump out the while loop even when the exit condition is met

来源:互联网 
#include<stdio.h>
#include <limits.h>

int main()
{
    int value;
    int smallest = INT_MAX;

    printf("This is a program that finds out the minimum \nof serveral integers you entered.");
    printf("Please type in these integers: ");

    while(scanf("%d", &value) != EOF)
    {
        printf(" ");

        if(value <= smallest)
        {
            smallest = value;
            printf("%d", smallest);    // to trace the while loop
        }
    }
    printf("\nThe smallest integer is: %d", smallest);    // this will execute once the program is stopped
    return 0;
}
#include<stdio.h>
#include <limits.h>

int main



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: