Computer Knowledge
Aptitude · Reasoning · English · CS — Corporate & Campus Interview Prep
94 Questions 5 Topics Take Test
Advertisement
Showing 11–20 of 94 questions
Q.11 Easy C Programming
What is the return type of the strlen() function?
A void
B char
C int
D float
Correct Answer:  C. int
Explanation:

The strlen() function returns the length of a string as an int value, representing the number of characters.

Take Test
Q.12 Easy C Programming
Which operator has the highest precedence in C?
A Addition (+)
B Multiplication (*)
C Parentheses ()
D Logical AND (&&)
Correct Answer:  C. Parentheses ()
Explanation:

Parentheses () have the highest precedence among all operators in C. They are always evaluated first in any expression.

Take Test
Q.13 Easy C Programming
What is the size of an integer variable in most modern C compilers?
A 2 bytes
B 4 bytes
C 8 bytes
D It depends on the compiler
Correct Answer:  B. 4 bytes
Explanation:

On most modern 32-bit and 64-bit systems, an int is typically 4 bytes (32 bits). However, the exact size can vary depending on the compiler and system architecture.

Take Test
Q.14 Easy C Programming
Which of the following is NOT a valid C data type?
A float
B boolean
C double
D char
Correct Answer:  B. boolean
Explanation:

C does not have a built-in boolean data type. The other options (float, double, char) are all valid primitive data types in C. Boolean functionality is typically implemented using int (0 for false, non-zero for true).

Take Test
Q.15 Easy C Programming
What is the purpose of the & operator in C?
A Bitwise AND operation
B Address-of operator
C Both A and B
D Logical AND operation
Correct Answer:  C. Both A and B
Explanation:

The & operator has two uses in C: (1) When used before a variable, it returns the memory address of that variable (address-of operator), and (2) When used between two integers, it performs a bitwise AND operation.

Take Test
Advertisement
Q.16 Easy C Programming
Which keyword is used to create a constant variable in C?
A final
B constant
C const
D static
Correct Answer:  C. const
Explanation:

The const keyword is used in C to declare a constant variable whose value cannot be modified after initialization. Variables declared as const are read-only.

Take Test
Q.17 Easy C Programming
What is the output of sizeof(char) in C?
A 0 bytes
B 1 byte
C 2 bytes
D Varies by compiler
Correct Answer:  B. 1 byte
Explanation:

By the C standard, sizeof(char) is always 1 byte. A char is the smallest addressable unit in C and is defined to be 1 byte.

Take Test
Q.18 Easy C Programming
How many times will the loop execute?
for(int i = 0; i < 5; i++)
A 4 times
B 5 times
C 6 times
D Infinite times
Correct Answer:  B. 5 times
Explanation:

The loop initializes i to 0 and continues while i < 5. Values of i: 0, 1, 2, 3, 4. After i becomes 5, the condition is false, so the loop executes 5 times.

Take Test
Q.19 Easy C Programming
What will be the value of x after: int x = 5; x += 3;
A 3
B 5
C 8
D 53
Correct Answer:  C. 8
Explanation:

The += operator is a compound assignment operator. x += 3 is equivalent to x = x + 3. Therefore, 5 + 3 = 8.

Take Test
Q.20 Easy C Programming
What is the size of int data type in a 32-bit system?
A 2 bytes
B 4 bytes
C 8 bytes
D 1 byte
Correct Answer:  B. 4 bytes
Explanation:

In a 32-bit system, the int data type typically occupies 4 bytes (32 bits). This is the standard size for integer types on most 32-bit architectures.

Take Test
IGET
iget AI
Online · Ask anything about exams
Hi! 👋 I'm your iget AI assistant.

Ask me anything about exam prep, MCQ solutions, study tips, or strategies! 🎯
UPSC strategy SSC CGL syllabus Improve aptitude NEET Biology tips