Skip to content

Category Archives: Quizzes

#include<stdio.h>  void f(int *p, int *q)  {    p = q;    *p = 2;  }  int i = 0, j = 1;  int main()  {    f(&i,… Read More
The reason for using pointers in a Cprogram is (A) Pointers allow different functions to share and modify their local variables. (B) To pass large… Read More
#include<stdio.h> void fun(int arr[]) {   int i;   int arr_size = sizeof(arr)/sizeof(arr[0]);   for (i = 0; i < arr_size; i++)       printf("%d ", arr[i]); }    int… Read More
Predict the output? #include <stdio.h> int fun(char *str1) {   char *str2 = str1;   while(*++str1);   return (str1-str2); }    int main() {   char *str = "GeeksQuiz";… Read More
Assume sizeof an integer and a pointer is 4 byte. Output? #include <stdio.h>    #define R 10 #define C 20    int main() {    int… Read More
What is the output of following program? #include <stdio.h>    int main() {    int a = 1;    int b = 1;    int c = a… Read More
What is the worst case time complexity of following implementation of subset sum problem. // Returns true if there is a subset of set[] with… Read More
What is time complexity of fun()? int fun(int n) {   int count = 0;   for (int i = n; i > 0; i /= 2)… Read More
#include <stdio.h> #define X 3 #if !X     printf("Geeks"); #else     printf("Quiz");     #endif int main() {         return 0; } (A) Geeks (B) Quiz (C) Compiler Error… Read More
Which of the following is true about return type of functions in C? (A) Functions can return any type (B) Functions can return any type… Read More
In C, parameters are always (A) Passed by value (B) Passed by reference (C) Non-pointer variables are passed by value and pointers are passed by… Read More
void fun(int *p)  {    int q = 10;    p = &q;  }           int main()  {    int r = 20;    int *p = &r;    fun(p); … Read More
int main() {  char *ptr = "GeeksQuiz";  printf("%c\n", *&*&*ptr);  return 0; } (A) Compiler Error (B) Garbage Value (C) Runtime Error (D) G Answer: (D)… Read More
#include<stdio.h>  int main()  {     int a;     char *x;     x = (char *) &a;     a = 512;     x[0] = 1;     x[1] = 2;     printf("%d\n",a);       return 0; … Read More
#include<stdio.h> int main() {     int arr[] = {10, 20, 30, 40, 50, 60};     int *ptr1 = arr;     int *ptr2 = arr + 5;     printf("Number of… Read More

Start Your Coding Journey Now!