Programming - Programming in C MCQS

A. Print format
B. Print function
C. Print file
D. Print formatted output
A. int
B. char
C. real
D. double
A. Returns size of a variable
B. Returns ASCII value
C. Returns the memory address
D. Returns pointer size
A. // Comment
B. /* Comment */
C. # Comment
D. -- Comment
A. 16
B. 11
C. 10
D. 13
A. const
B. constant
C. Const
D. #define
A. Exit the program
B. Skip to the next case
C. Exit the loop
D. Terminate the switch statement
A. function myFunction()
B. def myFunction():
C. void myFunction()
D. myFunction()
A. Allocate memory for an array
B. Free allocated memory
C. Allocate memory for a variable
D. Allocate and initialize memory for an array
A. Create a new data type
B. Define a variable
C. Declare a function
D. Include a header file
A. %f
B. %d
C. %s
D. %c
A. read()
B. getchar()
C. getc()
D. scanf()
A. A
B. B
C. 66
D. 67
A. int* ptr;
B. pointer ptr;
C. *ptr int;
D. ptr* int;
A. Exit the loop
B. Skip to the next iteration
C. Restart the loop
D. Terminate the program
A. #include "file.h"
B. include "file.h"
C. #include
D. include
A. Define a constant
B. Declare a variable
C. Create a static function
D. Preserve variable value between function calls
A. Hello
B. ello
C. H
D. e
A. ->
B. *
C. ::
D. .
A. Read a character
B. Read a string
C. Read an integer
D. Read a float
A. Concatenate strings
B. Copy strings
C. Compare strings
D. Convert strings
A. fopen("file.txt", "r");
B. open("file.txt", "w");
C. fopen("file.txt", "w");
D. open("file.txt", "r");
A. Concatenate strings
B. Copy strings
C. Compare strings
D. Convert strings
A. close(file);
B. fclose(file);
C. file.close();
D. endfile(file);
A. Size of the pointer
B. Size of the data type pointed to
C. Size of the memory allocated
D. Size of the address
A. &&
B.

A. -6
B. 5
C. 6
D. -5
A. Combine two arrays
B. Combine two structures
C. Combine two functions
D. Combine two variables
A. $
B. #
C. @
D. &
A. Allocate memory for an array
B. Free allocated memory
C. Allocate memory for a variable
D. Allocate and initialize memory for an array
A. strcmp()
B. strcompare()
C. compare()
D. stringcmp()
A. A
B. B
C. 65
D. 66
A. const *ptr;
B. *const ptr;
C. const ptr;
D. const int *ptr;
A. Execute the loop at least once
B. Iterate over a range of values
C. Execute the loop until a condition is true
D. Execute the loop based on a condition
A. Declare a volatile variable
B. Indicate an unstable function
C. Declare a constant variable
D. Indicate a variable that can change unexpectedly
A. Generate a random float
B. Generate a random integer
C. Return a fixed value
D. Find the square root
A. global var;
B. int global;
C. extern int global;
D. static global;
A. 3.33
B. 3.0
C. 3
D. 3.333333
A. Compare strings
B. Concatenate strings
C. Copy a specified number of characters from one string to another
D. Convert strings
A. int arr[][];
B. int arr[];
C. int arr[][] = new int[];
D. int arr[][3];
A. Search for a character in a string
B. Search for a string in another string
C. Compare strings
D. Concatenate strings
A. const *ptr;
B. *const ptr;
C. const ptr;
D. const int *ptr;
A. Declare a structure
B. Declare an enumeration
C. Declare a function
D. Declare a variable
A. stdlib.h
B. string.h
C. stdio.h
D. math.h
A. Tokenize a string
B. Compare strings
C. Concatenate strings
D. Copy strings
A. struct myStruct;
B. struct = myStruct;
C. myStruct struct;
D. struct myStruct { };
A. Close a file
B. Terminate the program
C. Return from a function
D. Print a message
A. 4
B. 8
C. 2
D. 1
A. int constant = 5;
B. constant int = 5;
C. const int constant = 5;
D. int constant(5);
A. 20
B. 10
C. 40
D. 5
A. #define MACRO_NAME()
B. define MACRO_NAME():
C. #macro MACRO_NAME
D. #define MACRO_NAME value
A. Get a character without echoing to the screen
B. Get a character with echoing to the screen
C. Get an integer
D. Get a float
A. Declare an automatic variable
B. Declare an automatic pointer
C. Automatically allocate memory
D. Auto-cast variables
A. &
B.

C. ^
A. 1
B. 2
C. 0
D. 3
A. const *ptr;
B. *const ptr;
C. const ptr;
D. const int *const ptr;
A. Compare memory
B. Copy memory
C. Concatenate memory
D. Allocate memory
A. int (*funcPtr)();
B. int funcPtr();
C. (*int funcPtr)();
D. int *funcPtr();
A. 10
B. 20
C. 1
D. 0
A. Concatenate strings
B. Copy strings
C. Compare strings
D. Convert strings
A. int arr[];
B. int arr[10];
C. int *arr = malloc(10 * sizeof(int));
D. int arr[10] = new int[10];
A. a
B. A
C. b
D. B
A. #define MACRO_NAME() { }
B. #define MACRO_NAME { }
C. #macro MACRO_NAME { }
D. #macro MACRO_NAME() { }
A. Flush the keyboard buffer
B. Flush the output buffer
C. Flush the standard input
D. Flush the file stream
A. int (*funcPtr[5])();
B. int funcPtr5;
C. (*int funcPtr[5])();
D. int *funcPtr5;