---
# System prepended metadata

title: 清中 quiz (2022/09/13)

---

# 清中 quiz (2022/09/13)

---
----Question 1----
請問下列程式碼的輸出為何？
```
int num=5;
printf("%d\n%d",num,num+1);
```

A ```5 5```
B ```5 6```
C 
```
5 
6
```
D```5\n6```

---
----Question 2----
請問下列程式碼的輸出為何？
```
int a=5,b=3;
a=a/4;
b=b%3;
printf("%d %d",a,b);
```

A ```1.25 1```
B ```1.25 0```
C ```1 1```
D ```1 0```

---
----Question 3----
請問下列程式碼在執行後如果輸入5和3，請問a,b內容是什麼？
```
scanf("%d%d",&a,&b);
int a,b;
```

A ```a=5 b=3```
B ```程式無法執行```
C ```a、b都是未知數```
D ```a=5 b=未知數```

---
----Question 4----
請問下列程式碼的輸出為何？
```
float a=5,b=4;
float c=2;
int ans = a/c + b/c;
printf("%d",ans);
```

A ```%d改成%f才有輸出結果```
B ```4.5```
C ```4```
D ```5```

---
----Question 5----
請問下列程式碼的輸出為何？
```
int x=5,y=6;
x=++y;
printf("%d %d",x,y);
```

A ```5 7```
B ```7 7```
C ```6 7```
D ```6 6```

---
----Question 6----
如果要讓下列程式碼的結果為True，請問下列哪一組```x y z```可滿足？
```
 x>=3 && y<=6 || z>=5
```

A ```2 5 3```
B ```4 7 4```
C ```1 9 0```
D ```3 7 6```

---
----Question 7----
請問下列程式的輸出為何？
```
int score = 1000;
if(30<=score<=100)
{
    printf("Yes");
}
    
```

A ```Yes```
B ```程式會執行，但沒有輸出```
C ```程式不會執行(連小黑窗都跑不出來）```

---
----Question 8----
請問下列迴圈會印出幾個```Hi```？
```
for(int i=0;i<6;i=i+2)
{
    printf("Hi\n");
}
```

A ```1```
B ```2```
C ```3```
D ```4```

---
----Question 9----
請問```3|4```的結果為何？（「|」是or運算的意思）

A ```7```
B ```4```
C ```3```
D ```1```

---
----Question 10----
請問下列程式碼的輸出為何？
```
int arr[5]={1,3,5,9,10};
printf("%d",arr[5]);
```

A ```10```
B ```0```
C ```程式當掉```
D ```以上皆有可能```

---