任何人都可以解释为什么这段代码会给出运行时错误?

Sha*_*Raj 0 c runtime-error

我没有找到该程序的正确输出.它给出了运行时错误.

#include <stdio.h>
int main()
{
    int c = 5, no = 10;
    do {
        no /= c;
    } while(c--);

    printf ("%d\n", no);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

Eug*_*Sh. 5

它除以零.由于您在循环计数器中使用了后递减c,因此它将成为0最后一次迭代.