关于while循环中的summing.c程序中while条件的疑问

程序如下:
#include <stdio.h>
#include <stdlib.h>

int main()
{
    long num;
    long sum=0L;
    int status;
    printf("please enter an integer to be summed");
    printf("(q to quit):");
    status=scanf("%ld",&num);
    while(status==1)
    {
        sum=sum+num;
        printf("please enter next integer(q to quit):");
        status=scanf("%ld",&num);
    }
    printf("those integers sum to %ld.\n",sum);

    return 0;
}
程序运行如下:

问题:
在while循环条件处:while(status==1),但status=scanf("%ld",&num),将出入的num长整型赋予status,while(status==1)是怎样处理测试循环条件的?请大神解答。


版权声明:本文为yemaozi31478188原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/yemaozi31478188/article/details/80594871