iGET

C Programming - MCQ Practice Questions

Practice free C Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

978 questions | 100% Free

Q.481Medium

For char arr[5] = {'a', 'b', 'c', 'd', 'e'}, is this a valid string?

Q.482Easy

Consider the following code: char str[] = "HELLO"; int len = 0; while(str[len] != '\0') { len++; } printf("%d", len); What will be the output?

Q.483Easy

Which operator is used to get the address of a variable in C?

Q.484Easy

What will be the size of a pointer variable on a 64-bit system?

Q.485Easy

What is a NULL pointer?

Q.486Medium

What is the output? int a = 5; int *p = &a; int q = &p; printf("%d", q);

Q.487Medium

What happens when you increment a pointer? int arr[5] = {1,2,3,4,5}; int *p = arr; p++;

Q.488Easy

Which of the following is NOT a valid pointer declaration?

Q.489Medium

What is the output? int x = 10, y = 20; int *p = &x; int *q = &y; p = q; printf("%d", *p);

Q.490Easy

Identify the output: char *str = "Hello"; printf("%c", *str);

Q.491Hard

What is the difference between *p++ and (*p)++?

Q.492Medium

What will be printed? int arr[] = {1, 2, 3}; int *p = arr; printf("%d", *(p+2));

Q.493Medium

What is a wild pointer?

Q.494Medium

What is the output? int *p = NULL; if(p) printf("Not NULL"); else printf("NULL");

Q.495Medium

Which of the following correctly allocates memory for 10 integers?

Q.496Medium

What is a dangling pointer?

Q.497Hard

What does the following code do? int *p = (int*)malloc(sizeof(int)); *p = 5; free(p); p = NULL;

Q.498Medium

What will be the output? int arr[] = {10, 20, 30}; int *p = arr; printf("%d %d", arr[1], *(p+1));

Q.499Hard

Which statement is true about void pointers?

Q.500Hard

What is the output? int x = 50; int *p = &x; int *q = p; q = NULL; printf("%d", *p);