Computer Science, asked by mijinkbrahma84, 8 months ago

Which of the following is true for variable names in C ? *

1 point

(A) They can contain alphanumeric characters as well as special characters.

(B) It is not an error to declare a variable to be one of the keywords (like goto, static).

(C) Variable names cannot start with a digit.

(D) Variable can be of any length.

2) What is the output of this C code ?*

1 point



(A) 1

(B) 0

(C) Undefined behavior due to order of evaluation

(D) 2

3) Point out the error if any, in the while loop : ______. *

1 point



(A) The condition in while loop is must

(B) There should be a semicolon in the while loop

(C) The while loop should be replaced by for loop

(D) No error

4) What is right way to initialize arrays ? *

1 point

(A) int num[6]={2,4,12,5,45,5};

(B) int n{ }={2,4,12,5,45,5};

(C) int n{6}={2,4,12};

(D) int n(6)={2,4,12,5,45,5};

5) In C, if you pass an array as an argument to a function, what actually gets passed ? *

1 point

(A) Value of elements in array

(B) First element of array

(C) Base address of array

(D) Address of the last element of array

6) The output of the program is : *

1 point



(A) 20

(C) Compiler error

(B) 30

(D) Runtime error

7) If the two strings are identical,then strcmp( ) function returns *

1 point

(A) –1

(B) 0

(C) 1

Which of the following is true for variable names in C ? *

1 point

(A) They can contain alphanumeric characters as well as special characters.

(B) It is not an error to declare a variable to be one of the keywords (like goto, static).

(C) Variable names cannot start with a digit.

(D) Variable can be of any length.

2) What is the output of this C code ?*

1 point



(A) 1

(B) 0

(C) Undefined behavior due to order of evaluation

(D) 2

3) Point out the error if any, in the while loop : ______. *

1 point



(A) The condition in while loop is must

(B) There should be a semicolon in the while loop

(C) The while loop should be replaced by for loop

(D) No error

4) What is right way to initialize arrays ? *

1 point

(A) int num[6]={2,4,12,5,45,5};

(B) int n{ }={2,4,12,5,45,5};

(C) int n{6}={2,4,12};

(D) int n(6)={2,4,12,5,45,5};

5) In C, if you pass an array as an argument to a function, what actually gets passed ? *

1 point

(A) Value of elements in array

(B) First element of array

(C) Base address of array

(D) Address of the last element of array

6) The output of the program is : *

1 point



(A) 20

(C) Compiler error

(B) 30

(D) Runtime error

7) If the two strings are identical,then strcmp( ) function returns *

1 point

(A) –1

(B) 0

(C) 1
8) What is the maximum number of dimensions an array in C may have ? *

1 point

(A) 2

(B) 8

(C) 20

(D) Theoretically no limits. The only practical limits are memory and compilers.

9) Is the following statement declaration or definition : extern int i; *

1 point

(A) Declaration

(B) Function

(C) Definition

(D) Error

10) The expressions *ptr++ and ++*ptr are same. *

0 points

True

False

11) C provides the strcmp ( ) function to compare strings. *

0 points

True

False

12) A function cannot be defined inside another function. *

0 points

True

False

13) The default parameter passing mechanism is call by value. *

0 points

True

False

14) The expressions arr and &arr same for an array of 10 integers. *

0 points

True

False

15) Memory allocation can be done by using keyword ‘create’. *

0 points

True

False

16) The expressions int fun(intarr[]); andint fun(intarr[2]); are same. *

0 points

True

False

17) There can be two return statements inside a function. *

0 points

True

False

18) Break statement can be used to exit a loop. *

0 points


Answers

Answered by bhuvna789456
0

Answer:

   1. c) Variable names cannot start with a digit.

    2. b) 0

    3. a) The condition in the while loop is a must.

    4. a) int num[6]={2,4,12,5,45,5};

    5. c) Base address of the array.

     6. d) runtime error.

      7. b) 0

     8. d) Theoretically no limits. The only practical limits are memory and compilers.

      9. a) declaration

     10. False

     11. True

     12. True

     13. True

     14. False

     15. True

     16. False

     17. True.

      18. True.

 

Similar questions