Search Header Logo

C Programing --- chapter 4---1

Authored by 劉雲輝 劉雲輝

Computers

University

Used 5+ times

C Programing --- chapter 4---1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 10 pts

以下是一程式,輸入兩個整數a 及b,輸出a 除以b 的商及餘數。

請問程式中的空白處A要填入何程式碼?

int main(void)

{

int a=14, b=3;

printf("顯示兩數相除之商數:%d\n", a/b );

printf("顯示兩數相除之餘數:%d\n",   A   );

return 0;

}

a-b

a*b

a%b

b/a

2.

MULTIPLE CHOICE QUESTION

1 min • 10 pts

1.  以下是輸入一整數,判斷是否為偶數的C程式碼片斷,

請問程式中的空白處A要填入何程式碼?

int main(void)

{

 int a;

 printf("整數:");

 scanf("%d",&a);

 if (    A     )

   printf("%d為偶數\n",a);

 else

   printf("%d為奇數\n",a);

 return 0;

}

a/2=0

a%2=0

a/2==0

a%2==0

3.

MULTIPLE CHOICE QUESTION

1 min • 10 pts

以下是C程式碼片斷,請問當輸入為32767時,螢幕顯示為何?

int num;

scanf("%d \n",&num);

num=(num/100)%10;

printf("%d\n", num);

3

2

7

6

4.

MULTIPLE CHOICE QUESTION

1 min • 10 pts

以下是C程式碼片斷,請問螢幕顯示為何?

int main()

{

short int a = -5 ;

 printf("%d\n",~a);

 return 0;

}

5

-4

4

6

5.

MULTIPLE CHOICE QUESTION

1 min • 10 pts

以下是C程式碼片斷,請問螢幕顯示為何?

short int a=3, b=2, c=5;

printf("%d\n",a<b||c!=a);

0

-1

1

10

6.

MULTIPLE CHOICE QUESTION

1 min • 10 pts

x=7,則「x|10」的結果值為何?

(以十進位表示法表示)

7

10

14

15

7.

MULTIPLE CHOICE QUESTION

1 min • 10 pts

y=7,則「y&14」的結果值為何?

(以十進位表示法表示)

6

7

14

15

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?