[英]Why doesn't this code give any output, why does the execution not terminate?
每當我在代碼塊中運行這段代碼時,它都會編譯而沒有任何錯誤和警告,但是當我執行它時,它不會顯示任何 output 也不會像我運行的其他代碼那樣自行終止。
#include <stdio.h>
int main ()
{
int i = 1;
while (i<=10);
{
printf("%d \n",i);
i = i + 1;
}
}
由於拼寫錯誤,您創建了一個無限循環:
while (i<=10);
刪除分號。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.