C MCQ: C Multiple Choice Questions And Answers

C MCQ with answers and explanations for placement tests and job interviews. These solved C programming MCQ questions are useful for the campus placement of all freshers including Engineering Students, MCA students, Computer and IT Engineers, etc.

Our C MCQ ( C multiple Choice Questions ) focuses on all areas of the C programming language. We will regularly update the quiz and most interesting thing is that questions come in a random sequence. So every time you will feel new questions.

Note: Your score along with correct answers will be visible after answering all of these questions.

C Programming Multiple Choice Questions And Answers

C MCQ: C Programming Multiple Choice Questions And Answers

1 / 71

The default return type of function definition

2 / 71

Suppose a C program has floating constant 1.414, what's the best way to convert this as a "float" data type?

3 / 71

What is the similarity between a structure, union, and enumeration?

4 / 71

Are the expressions arr and &arr same for an array of 5 integers?

5 / 71

Which of the following is correct with respect to “Jump Statements” in C?

6 / 71

In a C file (say sourcefile1.c), an array is defined as follows. Here, we don’t need to mention arrary arr size explicitly in [] because the size would be determined by the number of elements used in the initialization.

int arr[] = {1,2,3,4,5};

 

In another C file (say sourcefile2.c), the same array is declared for usage as follows:

extern int arr[];

In sourcefile2.c, we can use sizeof() on arr to find out the actual size of arr.

7 / 71

Can we combine the two statements?

char *p;

p = (char*) malloc(100);

8 / 71

“typedef” in C basically works as an alias. Which of the following is correct for “typedef”?

9 / 71

For a given integer, which of the following operators can be used to “set” and “reset” a particular bit respectively?

10 / 71

If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?

11 / 71

Pick the best statement for the below program snippet:

struct {int a[2];} arr[] = {1,2};

 

12 / 71

Which of the following statements correct about k used in the below statement? 

char ****k;

 

13 / 71

For the following declaration of a function in C, pick the best statement

int [] fun(void (*fptr)(int *));

14 / 71

enum types are processed by

15 / 71

Which of the following symbol is used in the variable name?

16 / 71

In the following code, the P2 is Integer Pointer or Integer?

typedef int *ptr;
ptr p1, p2;

17 / 71

Select the type of linkage in C

18 / 71

Choose the correct statements

19 / 71

In the below statement, ptr1 and ptr2 are uninitialized pointers to int i.e. they are pointing to some random address that may or may not be valid address.

int* ptr1, ptr2;

20 / 71

In a C program snippet, the following are used for the definition of Integer variables?

int s;
unsigned u;
long l;
long long ll;

Pick the best statement for these.

21 / 71

the typedef has the advantage that they obey scope rules, that is they can be declared local to a function or a block whereas #define always had a global effect.

22 / 71

In the context of "break" and "continue" statements in C, pick the best statement.

23 / 71

Which of the following statement is correct for switch controlling expression?

24 / 71

Which statement is not true in C programming?

25 / 71

Are logical operator sequence points?

26 / 71

What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?

27 / 71

It is not advisable to use macros instead of functions because

28 / 71

Which of the following are correctly formed #define statements in C?

29 / 71

C variable cannot start with a

30 / 71

In a C program, the following variables are defined:

float x = 2.17;
double y = 2.17;
long double z = 2.17;

 

Which of the following is the correct way for printing these variables via printf?

31 / 71

Is there any difference between the two statements?
char *ch = "Aticleworld";
char ch[] = "Aticleworld";

32 / 71

In the context of C data types, which of the following is correct?

33 / 71

Is there any difference between the following two statements?

char *p=0;
char *t=NULL;

 

34 / 71

Is this the correct way for the NULL pointer assignment?

int i=0;
char *q=(char*)i;

35 / 71

If storage class is missing in the array definition, by default it will be taken to be

36 / 71

Suppose a, b, c and d are int variables. For ternary operator in C ( ? : ), pick the best statement.

37 / 71

The operator used to get value at address stored in a pointer variable is

38 / 71

Syntax of accessing the seventh element from the array in C.

Note: Array 0th position element is the first element.

39 / 71

Point out the correct statement about call by value

40 / 71

Let arr is an array. Which of the following are illegal

41 / 71

Which one is not a logical or relational operator?

42 / 71

Which Keyword is used to prevent any changes in the value of the variable

43 / 71

Which of the following is not a logical operator

44 / 71

Which header file is the NULL macro defined?

45 / 71

Which bitwise operator is suitable for checking whether a particular bit is on or off?

46 / 71

What is (void*)0?

47 / 71

Which keyword is used to give back the value?

48 / 71

A program attempts to generate as many permutations as possible of the string, 'abcd' by pushing the characters a, b, c, d in the same order onto a stack, but it may pop off the top character at any time. Which one of the following strings CANNOT be generated using this program?

49 / 71

A function used in the round off the value

50 / 71

i) sizeof(int);
ii) sizeof(int*);
iii) sizeof(int**);

Assuming size of pointer is 4 bytes and size of int is also 4 bytes, pick the most correct answer from the given options.

51 / 71

For the following “typedef” in C, pick the best statement

typedef int INT, *INTPTR, ONEDARR[10], TWODARR[10][10];

 

52 / 71

Which of the following is correct for a function definition along with storage-class specifier in C language?

53 / 71

In the statement expression1 >> expression2. if expression1 is a signed integer with its leftmost bit set to 1 then on right shifting it the result of the statement will vary from computer to computer

54 / 71

Select false statement

55 / 71

How will you free the allocated memory in C?

56 / 71

Which of the following functions from “stdio.h” can be used in place of printf()?

57 / 71

Let x be an integer which can take a value of 0 or 1. The statement if(x = =0) x = 1; else x = 0; is equivalent to which one of the following?

58 / 71

What’s the meaning of following declaration in C language?

int (*p)[5];

 

59 / 71

Bit fields CANNOT be used in the union.

60 / 71

Which of the following declaration is illegal?

61 / 71

Which is the correct option

62 / 71

Are the three declarations char **apple, char *apple[], and char apple[][] same?

63 / 71

Consider the following variable declarations and definitions in C

i) int var_9 = 1;
ii) int 9_var = 2;
iii) int _ = 3;

Choose the correct statement w.r.t. above variables.

64 / 71

calloc(m, n); is equivalent to

65 / 71

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

66 / 71

Are the expression *ptr++ and ++*ptr are same?

67 / 71

Are the properties of i, j and x, y in the following program same?

typedef unsigned long int uli;
uli i, j;
unsigned long int x, y;

 

68 / 71

If a two-dimensional array is used as a formal parameter, then

69 / 71

Pick the correct statement for const and volatile.

70 / 71

What is the value of a[4]?

int a[5]={1,2,4,1,0}

71 / 71

No of values function can return

Recommended Articles for you: