quiz

quiz

University

11 Qs

quiz-placeholder

Similar activities

Chap 1: What is a program made of?

Chap 1: What is a program made of?

University

13 Qs

21CSC305P - Machnine Learning - Quiz

21CSC305P - Machnine Learning - Quiz

University

15 Qs

Evaluasi Pertemuan 12 DRPL TI-3B

Evaluasi Pertemuan 12 DRPL TI-3B

University

15 Qs

cp06-01-1D-Array

cp06-01-1D-Array

University

10 Qs

DAA quiz2

DAA quiz2

University

15 Qs

Kuis Dadakan ;)

Kuis Dadakan ;)

10th Grade - University

15 Qs

Topic 4-2: Multiple if-else and switch-case

Topic 4-2: Multiple if-else and switch-case

University

10 Qs

1-基本数据类型

1-基本数据类型

University

10 Qs

quiz

quiz

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Soniga M

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which is valid C expression?
a) int my_num = 100,000;
b) int my_num = 100000;
c) int my num = 1000;
d) int $my_num = 10000;

a

b

c

d

Answer explanation

Space, comma and $ cannot be used in a variable name.

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following cannot be a variable name in C?
a) volatile
b) true
c) friend
d) export

a

b

c

d

Answer explanation

Volatile is C keyword.

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is short int in C programming?
a) The basic data type of C

b) Qualifier
c) Short is the qualifier and int is the basic data type
d) All of the mentioned

a

b

c

d

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Functions in C Language are always _________

a) Internal
b) External
c) Both Internal and External
d) External and Internal are not valid terms for functions

a

b

c

d

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What will be the output of the following C code?

  1. #include <stdio.h>

  2. int main()

  3. {

  4. int y = 10000;

  5. int y = 34;

  6. printf("Hello World! %d\n", y);

  7. return 0;

  8. }

Compile time error

Hello World! 34

Hello World! 1000

Hello World! followed by a junk value

Answer explanation

Since y is already defined, redefining it results in an error.

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What will happen if the following C code is executed?

  1. #include <stdio.h>

  2. int main()

  3. {

  4. int main = 3;

  5. printf("%d", main);

  6. return 0;

  7. }

It will cause a compile-time error

It will cause a run-time error

It will experience infinite looping

It will run without any error and prints 3

Answer explanation

C program can have same function name and same variable name.

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What will be the final value of x in the following C code?

  1. #include <stdio.h>

  2. void main()

  3. {

  4. int x = 5 * 9 / 3 + 9;

  5. }

3.75

Depends on compiler

24

3

Answer explanation

9/3=3

5*3=15

15+9=24

ans 24

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

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?