quiz

quiz

University

11 Qs

quiz-placeholder

Similar activities

Quiz - 1

Quiz - 1

University

8 Qs

CS6801- Multi­core Architectures and Programming

CS6801- Multi­core Architectures and Programming

University

10 Qs

java

java

University - Professional Development

8 Qs

FODS-Program Basics

FODS-Program Basics

University

15 Qs

C Language

C Language

10th Grade - University

11 Qs

Test in C Language

Test in C Language

University

10 Qs

POINTERS

POINTERS

University

10 Qs

Common errors in C programming

Common errors in C programming

University

15 Qs

quiz

quiz

Assessment

Quiz

Computers

University

Hard

Created by

Soniga M

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?