C Language (IB JIO – Free Mock Test)

4.9/5 - (59 votes)

C Language – Free Mock Test: चलिए हम बात करें ‘C Language‘ की, जो कंप्यूटर साइंस में एक महत्वपूर्ण भूमिका निभाती है। अगर आपने कभी कंप्यूटर प्रोग्रामिंग के बारे में सुना है, तो आपको ‘C Language’ के बारे में जरूर पता होगा। यह उस रास्ते का पहला कदम है जो आपको कंप्यूटर की दुनिया में ले जाता है, जहां आप कोडिंग के जादू को समझते हैं।

यदि आप ‘C Language’ में नए हैं, तो यह ब्लॉग पोस्ट आपके लिए खास होने वाली है। यहां हम एक मुफ्त मॉक टेस्ट के माध्यम से आपको ‘C Language’ की गहराईयों में ले जाएंगे। आपको इस टेस्ट में विभिन्न प्रश्नों का सामना करना होगा, जो आपकी सी भाषा की क्षमताओं को मापने के लिए एक महत्वपूर्ण मार्गदर्शक होगा।

मॉक टेस्ट एक अद्वितीय और मनोरंजक तरीका है शिक्षा का। यह आपको नए कोडर्स के लिए सीखने का एक अच्छा जरिया है और पेशेवर कोडर्स के लिए स्वाधीनता का मार्गदर्शन करता है। तो आपके पास अगर ‘C Language’ में अग्रसर होने का सपना है, तो इस मॉक टेस्ट को पूरा करना अनिवार्य है।

इस ब्लॉग पोस्ट में हम आपको ‘C Language’ के मॉक टेस्ट के बारे में विस्तृत जानकारी प्रदान करेंगे, साथ ही आपको महत्वपूर्ण कॉन्सेप्ट्स, टेस्ट पैटर्न और प्रश्नों का अभ्यास करने का मौका देंगे। तो आइए, तैयार हो जाइए और इस मॉक टेस्ट में अपनी क्षमताओं का मूल्यांकन करें, क्योंकि यह आपके कोडिंग करियर को आगे ले जाने में मदद करेगा।

C Language (IB JIO – Free Mock Test) For Information Technology and Computer Science Students

प्रश्न 1: What does the “C” in C programming language stand for?

  • a) Central
  • b) Computing
  • c) Compiled
  • d) Concurrent

सही उत्तर: c) Compiled

प्रश्न 2: Which of the following is not a basic data type in C?

  • a) int
  • b) float
  • c) bool
  • d) string

सही उत्तर: d) string

प्रश्न 3: Which keyword is used to define a constant in C?

  • a) const
  • b) constant
  • c) def
  • d) final

सही उत्तर: a) const

प्रश्न 4: Which symbol is used for the modulus operator in C?

  • a) %
  • b) &
  • c) $
  • d) *

सही उत्तर: a) %

प्रश्न 5: Which of the following is not a valid variable name in C?

  • a) myVariable
  • b) 123variable
  • c) _variable
  • d) variable_1

सही उत्तर: b) 123variable

प्रश्न 6: Which header file should be included to use the printf() function?

  • a) <input.h>
  • b) <stdio.h>
  • c) <output.h>
  • d) <print.h>

सही उत्तर: b) <stdio.h>

प्रश्न 7: What is the size of the int data type in C?

  • a) 2 bytes
  • b) 4 bytes
  • c) 8 bytes
  • d) It varies depending on the system

सही उत्तर: b) 4 bytes

प्रश्न 8: What is the result of the expression: 5 + 3 * 2 – 1?

  • a) 7
  • b) 9
  • c) 10
  • d) 11

सही उत्तर: c) 10

प्रश्न 9: Which of the following is the correct syntax to declare an array in C?

  • a) int array[];
  • b) array[] int;
  • c) int[] array;
  • d) int array[];

सही उत्तर: d) int array[];

प्रश्न 10: What is the output of the following code snippet?


int x = 5;
printf("%d", ++x);

सही उत्तर: 6

प्रश्न 11: Which loop is guaranteed to execute at least once in C?

  • a) for loop
  • b) while loop
  • c) do-while loop
  • d) All loops have the same behavior

सही उत्तर: c) do-while loop

प्रश्न 12: Which keyword is used to exit a loop in C?

  • a) exit
  • b) continue
  • c) return
  • d) break

सही उत्तर: d) break

प्रश्न 13: What is the output of the following code snippet?


int i;
for (i = 0; i < 5; i++) {
  if (i == 2)
    continue;
  printf("%d ", i);
}

सही उत्तर: 0 1 3 4

प्रश्न 14: What is the purpose of the switch statement in C?

  • a) Perform arithmetic operations
  • b) Control the flow of a program
  • c) Define a function
  • d) Declare a variable

सही उत्तर: b) Control the flow of a program

प्रश्न 15: What is the output of the following code snippet?


int x = 2;
switch (x) {
  case 1:
    printf("Case 1");
    break;
  case 2:
    printf("Case 2");
    break;
  case 3:
    printf("Case 3");
    break;
  default:
    printf("Default case");
}

सही उत्तर: Case 2

प्रश्न 16: What is the purpose of the continue statement in C?

  • a) Skip the remaining code in the loop and move to the next iteration
  • b) Terminate the loop and exit the current function
  • c) Transfer control to another part of the program
  • d) None of the above

सही उत्तर: a) Skip the remaining code in the loop and move to the next iteration

प्रश्न 17: What is the output of the following code snippet?


int i;
for (i = 0; i < 5; i++) {
  if (i == 2)
    break;
  printf("%d ", i);
}

सही उत्तर: 0 1

प्रश्न 18: What is the purpose of the do-while loop in C?

  • a) Execute a block of code repeatedly until a condition is true
  • b) Execute a block of code repeatedly while a condition is true
  • c) Execute a block of code at least once, and then repeatedly while a condition is true
  • d) Execute a block of code at least once, and then repeatedly until a condition is true

सही उत्तर: c) Execute a block of code at least once, and then repeatedly while a condition is true

प्रश्न 19: What is the output of the following code snippet?


int i = 0;
do {
  printf("%d ", i);
  i++;
} while (i < 5);

सही उत्तर: 0 1 2 3 4

प्रश्न 20: Which of the following is not a valid way to define a function in C?

  • a) void myFunction() { }
  • b) int myFunction() { }
  • c) myFunction() { }
  • d) int myFunction(int x) { }

सही उत्तर: c) myFunction() { }

प्रश्न 21: What is the purpose of a function prototype in C?

  • a) Declare the return type of a function
  • b) Define the body of a function
  • c) Declare the parameters of a function
  • d) None of the above

सही उत्तर: a) Declare the return type of a function

प्रश्न 22: What is the output of the following code snippet?


int square(int x) {
  return x * x;
}

int result = square(3);
printf("%d", result);

सही उत्तर: 9

प्रश्न 23: What is the purpose of the void keyword in a function declaration?

  • a) Indicate that the function returns nothing
  • b) Indicate that the function has no parameters
  • c) Indicate that the function is empty
  • d) Indicate that the function is recursive

सही उत्तर: a) Indicate that the function returns nothing

प्रश्न 24: What is the output of the following code snippet?


int max(int a, int b) {
  if (a > b)
    return a;
  else
    return b;
}

int result = max(4, 7);
printf("%d", result);

सही उत्तर: 7

प्रश्न 25: What is the purpose of the return statement in a function?

  • a) Terminate the execution of a function
  • b) Specify the value to be returned by the function
  • c) Transfer control to another part of the program
  • d) None of the above

सही उत्तर: b) Specify the value to be returned by the function

प्रश्न 26: What is the output of the following code snippet?


int square(int x) {
  return x * x;
}

void printSquare(int x) {
  int result = square(x);
  printf("%d", result);
}

printSquare(5);

सही उत्तर: 25

प्रश्न 27: What is the purpose of the #include directive in C?

  • a) Import header files
  • b) Declare variables
  • c) Define functions
  • d) Specify function prototypes

सही उत्तर: a) Import header files

प्रश्न 28: What is the output of the following code snippet?


#include <stdio.h>

int main() {
  printf("Hello, World!");
  return 0;
}

सही उत्तर: Hello, World!

प्रश्न 29: Which function is automatically called at the beginning of a C program execution?

  • a) start()
  • b) main()
  • c) execute()
  • d) initialize()

सही उत्तर: b) main()

प्रश्न 30: What is the purpose of the scanf() function in C?

  • a) Print formatted data
  • b) Read input from the standard input
  • c) Write output to the standard output
  • d) None of the above

सही उत्तर: b) Read input from the standard input

प्रश्न 31: What is the output of the following code snippet?


int x;
scanf("%d", &x);
printf("%d", x);

सही उत्तर: The output depends on the value entered by the user.

प्रश्न 32: Which format specifier is used to read or write a character in C?

  • a) %d
  • b) %f
  • c) %c
  • d) %s

सही उत्तर: c) %c

प्रश्न 33: What is the purpose of the & operator in the scanf() function?

  • a) Reference operator
  • b) Address operator
  • c) Indirection operator
  • d) None of the above

सही उत्तर: b) Address operator

प्रश्न 34: What is the output of the following code snippet?


char name[20];
scanf("%s", name);
printf("%s", name);

सही उत्तर: The output depends on the string entered by the user.

प्रश्न 35: Which format specifier is used to read or write a string in C?

  • a) %d
  • b) %f
  • c) %c</li

  • d) %s

सही उत्तर: d) %s

प्रश्न 36: What is the purpose of the gets() function in C?

  • a) Read formatted data from a string
  • b) Write formatted data to a string
  • c) Read a line from the standard input
  • d) Write a line to the standard output

सही उत्तर: c) Read a line from the standard input

प्रश्न 37: What is the output of the following code snippet?


char name[20];
gets(name);
printf("%s", name);

सही उत्तर: The output depends on the string entered by the user.

प्रश्न 38: Which function should be used to read a string that may contain spaces?

  • a) gets()
  • b) scanf()
  • c) fgets()
  • d) read()

सही उत्तर: c) fgets()

प्रश्न 39: What is the purpose of the fgets() function in C?

  • a) Read formatted data from a string
  • b) Write formatted data to a string
  • c) Read a line from the standard input
  • d) Write a line to the standard output

सही उत्तर: c) Read a line from the standard input

प्रश्न 40: What is the output of the following code snippet?


char str[20];
fgets(str, sizeof(str), stdin);
printf("%s", str);

सही उत्तर: The output depends on the line entered by the user.

प्रश्न 41: What is the purpose of the strlen() function in C?

  • a) Calculate the length of a string
  • b) Compare two strings
  • c) Copy a string
  • d) Concatenate two strings

सही उत्तर: a) Calculate the length of a string

प्रश्न 42: What is the output of the following code snippet?


char str[] = "Hello";
int length = strlen(str);
printf("%d", length);

सही उत्तर: 5

प्रश्न 43: Which function should be used to compare two strings in C?

  • a) strcmp()
  • b) strncmp()
  • c) strcasecmp()
  • d) strncasecmp()

सही उत्तर: a) strcmp()

प्रश्न 44: What is the purpose of the strcmp() function in C?

  • a) Compare two strings ignoring case
  • b) Compare two strings with case sensitivity
  • c) Compare a portion of two strings ignoring case
  • d) Compare a portion of two strings with case sensitivity

सही उत्तर: b) Compare two strings with case sensitivity

प्रश्न 45: What is the output of the following code snippet?


char str1[] = "Hello";
char str2[] = "Hello";
int result = strcmp(str1, str2);
printf("%d", result);

सही उत्तर: 0

प्रश्न 46: Which function should be used to concatenate two strings in C?

  • a) strcat()
  • b) strncat()
  • c) strlcat()
  • d) strncat_s()

सही उत्तर: a) strcat()

प्रश्न 47: What is the purpose of the strcat() function in C?

  • a) Concatenate two strings
  • b) Concatenate a portion of two strings
  • c) Concatenate two strings with a specified length
  • d) Concatenate two strings and ensurethat the resulting string does not exceed the buffer size

सही उत्तर: a) Concatenate two strings

प्रश्न 48: What is the output of the following code snippet?


char str1[20] = "Hello";
char str2[] = " World";
strcat(str1, str2);
printf("%s", str1);

सही उत्तर: Hello World

प्रश्न 49: Which function should be used to copy one string to another in C?

  • a) strcpy()
  • b) strncpy()
  • c) strlcpy()
  • d) strncpy_s()

सही उत्तर: a) strcpy()

प्रश्न 50: What is the purpose of the strcpy() function in C?

  • a) Copy one string to another
  • b) Copy a portion of one string to another
  • c) Copy one string to another with a specified length
  • d) Copy one string to another and ensure that the destination buffer does not overflow

सही उत्तर: a) Copy one string to another

प्रश्न 51: What is the output of the following code snippet?


char str1[20] = "Hello";
char str2[20];
strcpy(str2, str1);
printf("%s", str2);

सही उत्तर: Hello

प्रश्न 52: What is the purpose of the malloc() function in C?

  • a) Allocate memory dynamically
  • b) Deallocate memory
  • c) Initialize memory with zeros
  • d) None of the above

सही उत्तर: a) Allocate memory dynamically

प्रश्न 53: What is the output of the following code snippet?


int *ptr = malloc(sizeof(int));
*ptr = 5;
printf("%d", *ptr);
free(ptr);

सही उत्तर: 5

प्रश्न 54: What is the purpose of the free() function in C?

  • a) Allocate memory dynamically
  • b) Deallocate memory
  • c) Initialize memory with zeros
  • d) None of the above

सही उत्तर: b) Deallocate memory

प्रश्न 55: What is the output of the following code snippet?


int *ptr = malloc(sizeof(int));
*ptr = 5;
free(ptr);
printf("%d", *ptr);

सही उत्तर: The behavior is undefined. It may print garbage or cause a runtime error.

प्रश्न 56: What is the purpose of the typedef keyword in C?

  • a) Define a new data type
  • b) Declare a variable
  • c) Define a constant
  • d) Import a header file

सही उत्तर: a) Define a new data type

प्रश्न 57: What is the output of the following code snippet?


typedef int Number;
Number x = 5;
printf("%d", x);

सही उत्तर: 5

प्रश्न 58: What is the purpose of the struct keyword in C?

  • a) Define a new data type that can hold multiple variables of different types
  • b) Declare a variable
  • c) Define a constant
  • d) Import a header file

सही उत्तर: a) Define a new data type that can hold multiple variables of different types

प्रश्न 59: What is the output of the following code snippet?


struct Point {
  int x;
  int y;
};

struct Point p;
p.x = 2;
p.y = 3;
printf("%d, %d", p.x, p.y);

सही उत्तर: 2, 3

प्रश्न 60: What is the purpose of the dot operator (.) in C?

  • a) Access members of a struct or union
  • b) Perform arithmetic operations
  • c) Compare values
  • d) None of the above

सही उत्तर: a) Access members of a struct or union

प्रश्न 61: What is the output of the following code snippet?


struct Rectangle {
  int length;
  int width;
};

struct Rectangle r;
r.length = 5;
r.width = 3;
int area = r.length * r.width;
printf("%d", area);

सही उत्तर: 15

प्रश्न 62: What is the purpose of the -> operator in C?

  • a) Access members of a struct or union
  • b) Perform arithmetic operations
  • c) Compare values
  • d) None of the above

सही उत्तर: a) Access members of a struct or union

प्रश्न 63: What is the output of the following code snippet?


struct Point {
  int x;
  int y;
};

struct Point *p;
struct Point q;
p = &q;
p->x = 2;
p->y = 3;
printf("%d, %d", q.x, q.y);

सही उत्तर: 2, 3

प्रश्न 64: What is the purpose of the enum keyword in C?

  • a) Define a new data type that represents a set of named constants
  • b) Declare a variable
  • c) Define a constant
  • d) Import a header file

सही उत्तर: a) Define a new data type that represents a set of named constants

प्रश्न 65: What is the output of the following code snippet?


enum Day {
  MON,
  TUE,
  WED,
  THU,
  FRI,
  SAT,
  SUN
};

enum Day today = WED;
printf("%d", today);

सही उत्तर: 2

प्रश्न 66: What is the purpose of the sizeof() operator in C?

  • a) Calculate the size of a data type or variable in bytes
  • b) Perform arithmetic operations
  • c) Compare values
  • d) None of the above

सही उत्तर: a) Calculate the size of a data type or variable in bytes

प्रश्न 67: What is the output of the following code snippet?


int arr[] = {1, 2, 3, 4, 5};
int size = sizeof(arr) / sizeof(arr[0]);
printf("%d", size);

सही उत्तर: 5

प्रश्न 68: What is the purpose of the & operator in C?

  • a) Address operator
  • b) Reference operator
  • c) Indirection operator
  • d) None of the above

सही उत्तर: a) Address operator

प्रश्न 69: What is the output of the following code snippet?


int x = 5;
int *ptr = &x;
printf("%d", *ptr);

सही उत्तर: 5

प्रश्न 70: What is the purpose of the * operator in C?

  • a) Dereference operator
  • b) Multiplication operator
  • c) Indirection operator
  • d) None of the above

सही उत्तर: a) Dereference operator

प्रश्न 71: What is the output of the following code snippet?


int x = 5;
int *ptr = &x;
*ptr = 10;
printf("%d", x);


सही उत्तर: 10

प्रश्न 72: What is the purpose of the & operator in the context of function parameters?

  • a) Pass a parameter by reference
  • b) Pass a parameter by value
  • c) Pass a parameter by address
  • d) None of the above

सही उत्तर: a) Pass a parameter by reference

प्रश्न 73: What is the output of the following code snippet?


void increment(int *ptr) {
  (*ptr)++;
}

int x = 5;
increment(&x);
printf("%d", x);

सही उत्तर: 6

प्रश्न 74: What is the purpose of the const keyword in C?

  • a) Define a constant
  • b) Declare a variable
  • c) Import a header file
  • d) None of the above

सही उत्तर: a) Define a constant

प्रश्न 75: What is the output of the following code snippet?


const int x = 5;
x = 10;
printf("%d", x);

सही उत्तर: The code will result in a compilation error.

प्रश्न 76: What is the purpose of the volatile keyword in C?

  • a) Indicate that a variable may be modified by external factors
  • b) Indicate that a variable cannot be modified
  • c) Declare a variable
  • d) None of the above

सही उत्तर: a) Indicate that a variable may be modified by external factors

प्रश्न 77: What is the output of the following code snippet?


volatile int x = 5;
x = 10;
printf("%d", x);

सही उत्तर: 10

प्रश्न 78: What is the purpose of the break statement in C?

  • a) Exit the current loop or switch statement
  • b) Continue to the next iteration of a loop
  • c) Terminate the program
  • d) None of the above

सही उत्तर: a) Exit the current loop or switch statement

प्रश्न 79: What is the output of the following code snippet?


int i;
for (i = 0; i < 5; i++) {
  if (i == 3)
    break;
  printf("%d ", i);
}

सही उत्तर: 0 1 2

प्रश्न 80: What is the purpose of the continue statement in C?

  • a) Skip the remaining code in the current iteration of a loop and continue to the next iteration
  • b) Terminate the program
  • c) Exit the current loop or switch statement
  • d) None of the above

सही उत्तर: a) Skip the remaining code in the current iteration of a loop and continue to the next iteration

प्रश्न 81: What is the output of the following code snippet?


int i;
for (i = 0; i < 5; i++) {
  if (i == 2)
    continue;
  printf("%d ", i);
}

सही उत्तर: 0 1 3 4

प्रश्न 82: What is the purpose of the switch statement in C?

  • a) Select one of many code blocks to be executed based on the value of an expression
  • b) Perform arithmetic operations
  • c) Compare values
  • d) None of the above

सही उत्तर: a) Select one of many code blocks to be executed based on the value of an expression

प्रश्न 83: What is the output of the following code snippet?


int x = 2;
switch (x) {
  case 1:
    printf("One");
    break;
  case 2:
    printf("Two");
    break;
  case 3:
    printf("Three");
    break;
  default:
    printf("Other");
}

सही उत्तर: Two

प्रश्न 84: What is the purpose of the default statement in a switch statement?</

  • a) Specify the code block to be executed when none of the cases match the value of the expression
  • b) Specify the code block to be executed for the last case in the switch statement
  • c) Specify the code block to be executed when the switch statement is first encountered
  • d) None of the above

सही उत्तर: a) Specify the code block to be executed when none of the cases match the value of the expression

प्रश्न 85: What is the output of the following code snippet?


int x = 5;
switch (x) {
  case 1:
    printf("One");
    break;
  case 2:
    printf("Two");
    break;
  case 3:
    printf("Three");
    break;
  default:
    printf("Other");
}

सही उत्तर: Other

प्रश्न 86: What is the purpose of the #define directive in C?

  • a) Define a macro
  • b) Declare a variable
  • c) Import a header file
  • d) None of the above

सही उत्तर: a) Define a macro

प्रश्न 87: What is the output of the following code snippet?


#define MAX_VALUE 10
int x = MAX_VALUE;
printf("%d", x);

सही उत्तर: 10

प्रश्न 88: What is the purpose of the #ifdef directive in C?

  • a) Check if a macro is defined
  • b) Define a macro
  • c) Declare a variable
  • d) None of the above

सही उत्तर: a) Check if a macro is defined

प्रश्न 89: What is the output of the following code snippet?


#define DEBUG
#ifdef DEBUG
  printf("Debug mode");
#else
  printf("Release mode");
#endif

सही उत्तर: Debug mode

प्रश्न 90: What is the purpose of the #ifndef directive in C?

  • a) Check if a macro is not defined
  • b) Define a macro
  • c) Declare a variable
  • d) None of the above

सही उत्तर: a) Check if a macro is not defined

प्रश्न 91: What is the output of the following code snippet?


#ifndef DEBUG
  printf("Release mode");
#else
  printf("Debug mode");
#endif

सही उत्तर: Release mode

प्रश्न 92: What is the purpose of the #include directive in C?

  • a) Import a header file
  • b) Define a macro
  • c) Declare a variable
  • d) None of the above

सही उत्तर: a) Import a header file

प्रश्न 93: What is the output of the following code snippet?


#include <stdio.h>

int main() {
  printf("Hello, World!");
  return 0;
}

सही उत्तर: Hello, World!

प्रश्न 94: What is the purpose of the #pragma directive in C?

  • a) Provide compiler-specific instructions or control compilation behavior
  • b) Import a header file
  • c) Declare a variable
  • d) None of the above

सही उत्तर: a) Provide compiler-specific instructions or control compilation behavior

प्रश्न 95: What is the output of the following code snippet?


#include <stdio.h>

#pragma startup init
#pragma exit cleanup

void init() {
  printf("Initializing...");
}

void cleanup() {
  printf("Cleaning up...");
}

int main() {
  printf("Hello, World!");
  return 0;
}

सही उत्तर: Initializing…, Hello, World!, Cleaning up…

प्रश्न 96: What is the purpose of the typedef keyword in C?

  • a) Define a new data type
  • b) Declare a variable
  • c) Define a constant
  • d) Import a header file

सही उत्तर: a) Define a new data type

प्रश्न 97: What is the output of the following code snippet?


typedef int Number;
Number x = 5;
printf("%d", x);

सही उत्तर: 5

प्रश्न 98: What is the purpose of the struct keyword in C?

  • a) Define a new data type that can hold multiple variables of different types
  • b) Declare a variable
  • c) Define a constant
  • d) Import a header file

सही उत्तर: a) Define a new data type that can hold multiple variables of different types

प्रश्न 99: What is the output of the following code snippet?


struct Point {
  int x;
  int y;
};

struct Point p;
p.x = 2;
p.y = 3;
printf("%d, %d", p.x, p.y);

सही उत्तर: 2, 3

प्रश्न 100: What is the purpose of the dot operator (.) in C?

  • a) Access members of a struct or union
  • b) Perform arithmetic operations
  • c) Compare values
  • d) None of the above

सही उत्तर: a) Access members of a struct or union

प्रश्न 101: What is the output of the following code snippet?


struct Rectangle {
  int length;
  int width;
};

struct Rectangle r;
r.length = 5;
r.width = 3;
int area = r.length * r.width;
printf("%d", area);

सही उत्तर: 15

प्रश्न 102: What is the purpose of the -> operator in C?

  • a) Access members of a struct or union through a pointer
  • b) Perform arithmetic operations
  • c) Compare values
  • d) None of the above

सही उत्तर: a) Access members of a struct or union through a pointer

प्रश्न 103: What is the output of the following code snippet?


struct Point {
  int x;
  int y;
};

struct Point *p;
struct Point q;
p = &q;
p->x = 2;
p->y = 3;
printf("%d, %d", q.x, q.y);

सही उत्तर: 2, 3

प्रश्न 104: What is the purpose of the enum keyword in C?

  • a) Define a new data type that represents a set of named constants
  • b) Declare a variable
  • c) Define a constant
  • d) Import a header file

सही उत्तर: a) Define a new data type that represents a set of named constants

प्रश्न 105: What is the output of the following code snippet?


enum Day {
  MON,
  TUE,
  WED,
  THU,
  FRI,
  SAT,
  SUN
};

enum Day today = WED;
printf("%d", today);

सही उत्तर: 2

प्रश्न 106: What is the purpose of the sizeof() operator in C?

  • a) Calculate the size of a data type or variable in bytes
  • b) Perform arithmetic operations
  • c) Compare values
  • d) None of the above

सही उत्तर: a) Calculate the size of a data type or variable in bytes

प्रश्न 107: What is the output of the following code snippet?


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

(arr) / sizeof(arr[0]);
printf("%d", size);

सही उत्तर: 5

प्रश्न 108: What is the purpose of the & operator in C?

  • a) Address operator
  • b) Reference operator
  • c) Indirection operator
  • d) None of the above

सही उत्तर: a) Address operator

प्रश्न 109: What is the output of the following code snippet?


int x = 5;
int *ptr = &x;
printf("%d", *ptr);

सही उत्तर: 5

प्रश्न 110: What is the purpose of the * operator in C?

  • a) Dereference operator
  • b) Multiplication operator
  • c) Indirection operator
  • d) None of the above

सही उत्तर: a) Dereference operator

प्रश्न 111: What is the output of the following code snippet?


int x = 5;
int *ptr = &x;
*ptr = 10;
printf("%d", x);

सही उत्तर: 10

प्रश्न 112: What is the purpose of the & operator in the context of function parameters?

  • a) Pass a parameter by reference
  • b) Pass a parameter by value
  • c) Pass a parameter by address
  • d) None of the above

सही उत्तर: a) Pass a parameter by reference

प्रश्न 113: What is the output of the following code snippet?


void increment(int *ptr) {
  (*ptr)++;
}

int x = 5;
increment(&x);
printf("%d", x);

सही उत्तर: 6

प्रश्न 114: What is the purpose of the const keyword in C?

  • a) Define a constant
  • b) Declare a variable
  • c) Import a header file
  • d) None of the above

सही उत्तर: a) Define a constant

प्रश्न 115: What is the output of the following code snippet?


const int x = 5;
x = 10;
printf("%d", x);

सही उत्तर: The code will result in a compilation error.

प्रश्न 116: What is the purpose of the volatile keyword in C?

  • a) Indicate that a variable may be modified by external factors
  • b) Indicate that a variable cannot be modified
  • c) Declare a variable
  • d) None of the above

सही उत्तर: a) Indicate that a variable may be modified by external factors

प्रश्न 117: What is the output of the following code snippet?


volatile int x = 5;
x = 10;
printf("%d", x);

सही उत्तर: 10

प्रश्न 118: What is the purpose of the break statement in C?

  • a) Exit the current loop or switch statement
  • b) Continue to the next iteration of a loop
  • c) Terminate the program
  • d) None of the above

सही उत्तर: a) Exit the current loop or switch statement

प्रश्न 119: What is the output of the following code snippet?


int i;
for (i = 0; i < 5; i++) {
  if (i == 3)
    break;
  printf("%d ", i);
}

सही उत्तर: 0 1 2

प्रश्न 120: What is the purpose of the continue statement in C?

  • a) Skip the remaining code in the current iteration of a loop and continue to the next iteration
  • b) Terminate the program
  • c) Exit the current loop or switch statement
  • d) None of the above

सही उत्तर: a) Skip the remaining code in the current iteration of a loop and continue to the next iteration

प्रश्न 121: What is the output of the following code snippet?


int i;
for (i = 0; i < 5; i++) {
  if (i == 2)
    continue;
  printf("%d ", i);
}

सही उत्तर: 0 1 3 4

प्रश्न 122: What is the purpose of the switch statement in C?

  • a) Select one of many code blocks to be executed based on the value of an expression
  • b) Perform arithmetic operations
  • c) Compare values
  • d) None of the above

सही उत्तर: a) Select one of many code blocks to be executed based on the value of an expression

प्रश्न 123: What is the output of the following code snippet?


int x = 2;
switch (x) {
  case 1:
    printf("One");
    break;
  case 2:
    printf("Two");
    break;
  case 3:
    printf("Three");
    break;
  default:
    printf("Other");
}

सही उत्तर: Two

प्रश्न 124: What is the purpose of the default statement in a switch statement?

  • a) Specify the code block to be executed when none of the cases match the value of the expression
  • b) Specify the code block to be executed for the last case in the switch statement
  • c) Specify the code block to be executed when the switch statement is first encountered
  • d) None of the above

सही उत्तर: a) Specify the code block to be executed when none of the cases match the value of the expression

प्रश्न 125: What is the output of the following code snippet?


int x = 5;
switch (x) {
  case 1:
    printf("One");
    break;
  case 2:
    printf("Two");
    break;
  case 3:
    printf("Three");
    break;
  default:
    printf("Other");
}

सही उत्तर: Other

प्रश्न 126: What is the purpose of the #define directive in C?

  • a) Define a macro
  • b) Declare a variable
  • c) Import a header file
  • d) None of the above

सही उत्तर: a) Define a macro

प्रश्न 127: What is the output of the following code snippet?


#define MAX_VALUE 10
int x = MAX_VALUE;
printf("%d", x);

सही उत्तर: 10

प्रश्न 128: What is the purpose of the #ifdef directive in C?

  • a) Check if a macro is defined
  • b) Define a macro
  • c) Declare a variable
  • d) None of the above

सही उत्तर: a) Check if a macro is defined

प्रश्न 129: What is the output of the following code snippet?


#ifdef DEBUG
  printf("Debug mode");
#else
  printf("Release mode");
#endif

सही उत्तर: Debug mode

प्रश्न 130: What is the purpose of the #ifndef directive in C?

  • a) Check if a macro is not defined
  • b) Define a macro
  • c) Declare a variable
  • d) None of the above

सही उत्तर: a) Check if a macro is not defined

निष्कर्ष

संक्षेप में कहें तो, इस ब्लॉग पोस्ट में हमने आपको IB JIO के लिए FREE Mock Test ( मॉक टेस्ट ) के माध्यम से Information Technology और Computer Science के छात्रों के लिए C Programming Language के बारे में जानकारी प्रदान की है। हम निश्चित रूप से उम्मीद करते हैं कि यह जानकारी आपके लिए महत्वपूर्ण और उपयोगी रही होगी।

हमें यह जानकारी साझा करने का अवसर मिला है, ताकि इसे आप अपने साथियों और दोस्तों के साथ साझा कर सकें। हमारा उद्देश्य हमेशा से यही रहा है कि हम अपने पाठकों को महत्वपूर्ण और उपयोगी जानकारी प्रदान करें और उनकी मदद करें। हमें आपके लिए और अधिक सामग्री प्रदान करने का आशा है और हमें गर्व होगा अगर आप हमारे ब्लॉग पोस्ट को फिर से देखने और आपके ज्ञान को विस्तारित करने में मदद करने का आवाज बन सके।

अगर आपके मन में कोई सवाल या सुझाव है, तो कृपया निचे टिप्पणी बॉक्स में हमारे साथ साझा करें। हमें खुशी होगी आपकी सहायता करने में!

ब्लॉग पोस्ट का शीर्षक: “C Language Free Mock Test

हमेशा आपकी सेवा में,

आपका टीम Jivan Sahayata

Last updated: फ़रवरी 12, 2024

Related Posts