#請益 為什麼這支程式會無限迴圈?
2021年8月31日 12:45
各位午安,
最近小弟在初學C語言,
有碰到一個問題,
想請問各位高手幫我解惑。
下列的程式,為什麼會無限迴圈?
#include<stdio.h>
int main( void ){
printf(Enter the number : ");
int num;
scanf("$d", &num);
while ( num <= 100 ){
num = 3 * num;
printf("Now the number is %d\n", num);
}
}
不好意思,我沒有將問題敘述清除。
我輸入30。