C-Language MCQs > FREE SET - 1

1. In mathematics and computer programming, which is the correct order of mathematical operators?
A Addition, Subtraction, Multiplication, Division
B Division, Multiplication, Addition, Subtraction
C Multiplication, Addition, Division, Subtraction
D Addition, Division, Modulus, Subtraction

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

2. Which of the following cannot be checked in a switch-case statement?
A Character
B Integer
C Float
D enum

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

3. Which of the following is the correct order of evaluation for the below expression?
z = x + y * z / 4 % 2 - 1
A * / % + - =
B = * / % + -
C / * % - + =
D * % / - + =

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

4. Which of the following correctly shows the hierarchy of arithmetic operations in C?
A / + * -
B * - / +
C + - / *
D / * + -

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

5. Which of the following is the correct usage of conditional operators used in C?
A a>b ? c=30 : c=40;
B a>b ? c=30;
C max = a>b ? a>c?a:c:b>c?b:c
D return (a>b)?(a:b)

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

6. Which of the following are correctly formed #define statements in C?
A #define CUBE (X) (X*X*X);
B #define CUBE(x) (X*X*X)
C #define CUBE(X) (X*X*X)
D #define CUBE(X) {X*X*X}

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

7. Which of the following function sets first n characters of a string to a given character?
A strinit()
B strnset()
C strset()
D strcset()

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

8. If the two strings are identical, then strcmp() function returns
A -1
B 1
C 0
D Yes

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

9. How will you print \\n on the screen?
A printf("\\n");
B echo "\\\\n";
C printf('\\n');
D printf("\\\\n");

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

10. The library function used to find the last occurrence of a character in a string is
A strnstr()
B laststr()
C strrchr()
D strstr()

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

11. Which of the following function is used to find the first occurrence of a given string in another string?
A strchr()
B strrchr()
C strstr()
D strnset()

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

12. Which of the following function is more appropriate for reading in a multi-word string?
A printf();
B scanf();
C gets();
D puts();

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

13. What do the 'c' and 'v' in argv stands for?
A 'c' means argument control 'v' means argument vector
B 'c' means argument count 'v' means argument vertex
C 'c' means argument count 'v' means argument vector
D 'c' means argument configuration 'v' means argument visibility

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

14. Which of the following is TRUE about argv in reference to command line argument in C Language?
A It is an array of character pointers
B It is a pointer to an array of character pointers
C It is an array of strings
D None of above

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.

15. Which of the following statements are FALSE about the below code?
int main(int ac, char *av[])
{
}
A ac contains count of arguments supplied at command-line
B av[] contains addresses of arguments supplied at a command line
C In place of ac and av, argc and argv should be used.
D The variables ac and av are always local to main()

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

16. __________ converts all the source code into machine code, creating an executable file.
A Compiler
B Interpreter
C Assembler
D Linker

Free MCQs www.sharemcq.com     Answer: Option A
Explanation:
Available Soon.


No comments:

Post a Comment

Your Feedback is hearty Requested to make the MCQs Collection better.

Popular Posts