Here is the completely updated `question.php`. I added the missing `$breadcrumbs` array and defined `$category_name` and `$topic_name` right before the header is included. This ensures that `header.php` generates the correct Breadcrumb Schema, page title, and meta description for single question pages. Replace your entire `question.php` with this: ```php C Language Fundamentals Questions
Q. What will be the output of the following C code?
-1
2
Compile time error

Explanation:

This question tests your understanding of bitwise operators in C. Let's break down the code step by step.
The tilde (~) is the bitwise NOT operator. It flips all the bits of the variable `x`. Since `x` is 0 (which is represented as all 0s in binary), `~x` will become -1 (represented as all 1s in two's complement).
The ampersand (&) is the bitwise AND operator. It compares the corresponding bits of two operands. If both bits are 1, the resulting bit is 1; otherwise, it's 0.
We're performing a bitwise AND between `~x` (-1, all 1s) and `y` (2). Let's assume your system uses 32-bit integers (most do). Then 2 is represented as `00000000000000000000000000000010` in binary. The bitwise AND operation will be:

This results in 2.
This line prints the value of `z`, which is 2, to the console.

The exact binary representation and the behavior of bitwise NOT might depend slightly on your specific compiler and system architecture, but the principle remains the same.

Q. What is the purpose of the 'sizeof' operator in C?
Calculate square root
Convert to string
Determine size
Perform division

Explanation:

The purpose of the 'sizeof' operator in C is to of a data type or a variable in bytes. It is used to find out how much memory is allocated to a specific data type or an object in memory.

So, the correct answer is:


Here's an example of how 'sizeof' operator is used in C:




In this example, 'sizeof(int)' will return the size (in bytes) of the 'int' data type, and it will be stored in the 'size' variable. It is a valuable operator when you need to work with memory allocation and management in C.

Q. Which of the following are unary operators?
-
sizeof
++
all of the mentioned

Explanation:

No explanation is given for this question

Q. What will be the output of the following C function?
Undefined behaviour
1 2 3 4 5
Compilation error
Segmentation fault

Explanation:

No explanation is given for this question

Q. What will be the final values of a and c in the following C statement? (Initial values: a = 2, c = 1)
a = 2, c = 2;
a = 2, c = 1;
a = 1, c = 2;
a = 0, c = 0;

Explanation:

a = 2, c = 1;
The statement is:
This is a . The condition is , which means if , the expression before the colon is executed.
Since (non-zero), the true part is executed:
Then the value of the true expression () is assigned to .
So now:

(since the result of is 0)

Q. Which operator is used for 'logical AND' in C?
&
|
&&
||

Explanation:

The operator used for 'logical AND' in C is . The operator is used to perform a logical AND operation, which returns true if both of its operands are true, and false otherwise.

So, the correct answer is:


Here's an example of using the logical AND operator in C:





In this example, the code within the if statement will be executed only if both 'x' and 'y' are true.

Q. Pick the incorrect statement with respect to enums.
Enum variables are automatically assigned values if no value is specified
Two enum symbols cannot have the same value
Only integer constants are allowed in enums
It is not possible to change the value of enum symbols

Explanation:

No explanation is given for this question

Q. Which character is used to represent a comment in C code?
/*
#
;
//

Explanation:

The character used to represent a comment in C code is . In C, the double forward slash () is used to begin a single-line comment. Comments are used for adding explanations or notes within the code that are ignored by the compiler and are solely for human readability.

So, the correct answer is:


Here's an example of a single-line comment in C:

Q. What does the 'NULL' keyword represent in C?
An empty string
An uninitialized variable
A null character
A pointer to nothing

Explanation:

No explanation is given for this question

Q. Will the following C code compile without any error?
Depends on the C standard implemented by compilers
Yes
No
Error

Explanation:

No explanation is given for this question

Q. What is the size of myArray in the code shown below? (Assume that 1 character occupies 1 byte)
5 bytes
50 bytes
10 bytes
40 bytes

Explanation:

No explanation is given for this question

Q. Which data type is used to store a sequence of characters in C?
string
char
int
float

Explanation:

The data type used to store a sequence of characters in C is . In C, you can use an array of characters (often referred to as a "string") or simply a single character variable to store individual characters or sequences of characters.

So, the correct answer is:


In C, you can declare a character array (string) like this:

In this example, 'myString' is an array of characters, and it can store a sequence of characters, including letters, digits, symbols, and spaces.

Q. Variable name resolution (number of significant characters for the uniqueness of variable) depends on . . . . . . . .
Assemblers and loaders implementations
Compiler and linker implementations
None of the mentioned
C language

Explanation:

No explanation is given for this question

Q. Which of the following is not a valid C keyword?
printf
main
if
for

Explanation:

Among the options provided, is not a valid C keyword.

C keywords are reserved words that have special meanings in the language, and they cannot be used as identifiers (such as variable names or function names). Keywords like 'main,' 'if,' and 'for' are all valid C keywords with specific purposes in the language.

However, 'printf' is not a keyword; it's a standard C library function used for outputting formatted text. It can be used as a function name in C code.

So, the correct answer is:

Q. Assuming a short is two bytes long, what will be printed by the above code?
12
6
24
7

Explanation:

The following table provides the details of standard integer types with their storage sizes and value ranges ?

Q. What is the difference between a declaration and a definition of a variable?
A declaration occurs once, but a definition may occur many times.
Both can occur multiple times, but a declaration must occur first.
A definition occurs once, but a declaration may occur many times.
Both can occur multiple times, but a definition must occur first.

Explanation:

No explanation is given for this question

Q. Which operator is used to access the value stored at a pointer address in C?
&
->
*
.

Explanation:

No explanation is given for this question

Q. What is the purpose of the 'goto' statement in C?
Transfer control
End the program
Skip the current iteration
Skip a loop

Explanation:

No explanation is given for this question

Q. We want to declare x, y and z as pointers of type int. The alias name given is: intpt The correct way to do this using the keyword typedef is:
int typedef* intptr; intptr x,y,z;
typedef int* intptr; intptr x,y,z;
typedef* intptr; int x,y,z;
int typedef* intptr; int x,y,z;

Explanation:

No explanation is given for this question

Q. Which of following is not a valid name for a C variable?
Examveda
Both A and B
Exam veda
Exam_veda

Explanation:

No spaces are allowed in the variable names.

Q. What is the primary purpose of a function prototype in C?
Declare a function
Define a function
Assign a value
Declare a variable

Explanation:

The primary purpose of a function prototype in C is to . It serves as a forward declaration of the function, providing information about the function's name, return type, and the types of its parameters. This declaration allows the compiler to understand how the function should be called and used in the program before the actual function definition is encountered.

So, the correct answer is:


In C, a function prototype typically looks like this:


Here's an example:


This prototype informs the compiler that there's a function named "add" that returns an integer and takes two integer parameters. It doesn't define the function's implementation; it simply declares its existence and signature.

Q. What does the 'void' keyword indicate in a C function declaration?
Integer return
String return
Empty return type
Floating-point return

Explanation:

The 'void' keyword in a C function declaration indicates . When a function is declared with 'void' as its return type, it means that the function does not return any value.

Q. Which data type is used to represent a single character in C?
int
float
double
char

Explanation:

The data type used to represent a single character in C is . The data type is specifically designed to store individual characters, such as letters, digits, and symbols.

So, the correct answer is:


In C programming, you declare a character variable like this:



Here, is a variable of type , and it stores the character 'A'. The data type is essential for working with characters and strings in C.

Q. In C, which operator is used for pointer-to-pointer relationships?
*
::
->
&

Explanation:

In C, the operator used for pointer-to-pointer relationships is . The asterisk () operator is used for both declaring and dereferencing pointer variables. When you have a pointer-to-pointer (a pointer that points to another pointer), you use multiple asterisks to access the value pointed to by the second pointer.

So, the correct answer is:


Here's an example of a pointer-to-pointer relationship in C:

In this example, ptr2 is a pointer-to-pointer, and **ptr2 is used to access the value stored in num.

Q. What is the size of an int data type?
4 Bytes
8 Bytes
Cannot be determined
Depends on the system/compiler

Explanation:

No explanation is given for this question

Q. Which of the following is a ternary operator?
?:
->
>>=
&&

Explanation:

No explanation is given for this question

Q. Which symbol is used for the 'modulo' operation in C?
^
*
%
/

Explanation:

The symbol used for the 'modulo' operation in C is . The '%' symbol calculates the remainder when one number is divided by another and is commonly used for tasks such as checking for even or odd numbers and cycling through a range of values.

So, the correct answer is:


Here's an example of using the modulo operator in C:



In this example, the value of 'remainder' will be 1 because 10 divided by 3 is 3 with a remainder of 1.

Q. Find the output of the following program.
053 65
65 65
065 65
53 65

Explanation:

As octal 65 ( 065 ) is equivalent of decimal value 53.

Q. What is the maximum number of arguments that can be passed to a C function?
255
No limit
127
10

Explanation:

The maximum number of arguments that can be passed to a C function is . In C, there is no hard-coded limit on the number of arguments you can pass to a function. However, practical limitations may exist based on factors like system memory and stack size.

So, the correct answer is:

Q. Which is the only function all C programs must contain?
printf()
system()
start()
main()

Explanation:

No explanation is given for this question

Q. What is the purpose of the 'scanf' function in C?
Execute a loop
Print formatted output
Allocate memory
Read formatted input

Explanation:

No explanation is given for this question

Q. For 16-bit compiler allowable range for integer constants is ________?
-3.4e38 to 3.4e38
-32767 to 32768
-32768 to 32767
-32668 to 32667

Explanation:

In a 16 Bit C compiler we have 2 bytes to store an integer, and 1 byte for a character.
For unsigned integers the range is 0 to 65535.

For unsigned character, 0 to 255

Q. Relational operators cannot be used on . . . . . . . .
strings
float
structure
long

Explanation:

No explanation is given for this question

Q. Which of the following is not a correct variable type?
real
int
float
double

Explanation:

in C define the kind of data that can be stored in a variable.
- This is a correct variable type in C, used for storing single-precision floating-point numbers.
- This is not a correct variable type in C. There is no data type called in C.
- This is a correct variable type in C, used for storing integers.
- This is a correct variable type in C, used for storing double-precision floating-point numbers.
- This is a correct variable type in C, used for storing single characters.
Therefore, the correct answer is .

Q. What is the purpose of the 'const' keyword in C?
Initialize a pointer
Declare a constant
Declare a variable
Define a function

Explanation:

The purpose of the 'const' keyword in C is to . When you use the 'const' keyword before a variable declaration, it indicates that the value of that variable cannot be changed once it is assigned a value. It creates an immutable constant in your code.

So, the correct answer is:


Here's an example of using the 'const' keyword to declare a constant in C:


In this example, 'max_attempts' is declared as a constant integer, and its value cannot be modified after initialization.

Q. What will be printed after execution of the following program code?
hai
asiha
absiha
haasi

Explanation:

- newline - ""; - Prints
- backspace - ""; - firstly '' removes 'b' from 'ab ' and then prints 'si'. So after execution of ""; it is.
- linefeed - ""; - Now here '' moves the cursor to the start of the current line and then override 'asi' to .

Q. What is the purpose of the 'break' statement in C?
End the program
Exit a function
Skip the loop
Exit a loop

Explanation:

The purpose of the 'break' statement in C is to . When 'break' is encountered within a loop (such as 'for' or 'while' loop), it immediately terminates the loop and continues with the next statement after the loop's body.

So, the correct answer is:


Here's an example of using the 'break' statement to exit a loop in C:

Q. What is the correct syntax for declaring a variable in C?
int variable_name;
variable_name int;
variable_name = 5;
int = variable_name;

Explanation:

The correct syntax for declaring a variable in C is . In C, you declare a variable by specifying its data type followed by the variable name and a semicolon to terminate the declaration.

So, the correct answer is:


Here's an example:



In this example, we declare an integer variable named "age." This syntax informs the compiler that "age" is of type . Option B is incorrect because it's an assignment statement, not a declaration. Option C and Option D have incorrect syntax and are not valid ways to declare a variable in C.

Q. "My salary was increased by 15%"
Select the statement, which will EXACTLY reproduce the line of text above.
printf("My salary was increased by 15/%!");
printf("My salary was increased by 15%!");
printf("My salary was increased by 15'%'!");
printf("My salary was increased by 15%%!");

Explanation:

No explanation is given for this question

Q. Which of the following data type will throw an error on modulus operation(%)?
float
int
char
short

Explanation:

No explanation is given for this question

Q. One of the major difference between typedef and #define is that typedef interpretation is performed by the . . . . . . . . whereas #define interpretation is performed by the . . . . . . . .
pre-processor, compiler
compiler, user
user, pre-processor
compiler, pre-processor

Explanation:

No explanation is given for this question

Q. What is the default return type of a function in C if not specified?
int
char
float
void

Explanation:

The default return type of a function in C if not specified is . In C, if you don't explicitly specify the return type of a function, it is assumed to return an integer () by default.

So, the correct answer is:


For example, if you have a function like this:





The return type is assumed to be , and you can call it as if it returns an integer. If you want a function to return nothing, you explicitly specify as the return type.

Q. Which of the following typecasting is accepted by C?
Widening conversions
Widening & Narrowing conversions
None of the mentioned
Narrowing conversions

Explanation:

No explanation is given for this question

Q. Operation "a = a * b + a" can also be written as . . . . . . . .
All of the mentioned
a = (b + 1)* a;
a *= b + 1;
(c = a * b)!=(a = c + a);

Explanation:

No explanation is given for this question

Q. Which character is used to indicate the end of a statement in C?
;
.
,
:

Explanation:

The character used to indicate the end of a statement in C is . This semicolon is a crucial part of C syntax as it separates statements and tells the compiler where one statement ends and the next one begins.

So, the correct answer is:


In C programming, you terminate a statement with a semicolon. For example:


In the above code, the semicolon at the end of each line signifies the end of the respective statement.

Q. Which header file is used for mathematical functions in C?
<string.h>
<math.h>
<stdio.h>
<stdlib.h>

Explanation:

No explanation is given for this question

Q. Which of the following is an invalid assignment operator?
a |= 10;
None of the mentioned
a %= 10;
a /= 10;

Explanation:

No explanation is given for this question

Q. For which of the following, "PI++;" code will fail?
char *PI = "A";
none of the Mentioned
#define PI 3.14
float PI = 3.14;

Explanation:

No explanation is given for this question

Q. If integer needs two bytes of storage, then maximum value of an unsigned integer is
2
2
2
2

Explanation:

An integer is a number with no fractional part; it can be positive, negative or zero. In ordinary usage, one uses a minus sign to designate a negative integer. However, a computer can only store information in bits, which can only have the values zero or one. We might expect, therefore, that the storage of negative integers in a computer might require some special technique. As you might imagine, an unsigned integer is either positive or zero.

Consider a single digit decimal number: In a single decimal digit, you can write a number between 0 and 9. In two decimal digits, you can write a number between 0 and 99, and so on.

Since nine is equivalent to 10 - 1,
99 is equivalent to 10 - 1, etc.

In n decimal digits, you can write a number between 0 and 10 - 1.
So, analogously, in the binary number system,

An unsigned integer containing n bits can have a value between 0 and 2 - 1
(which is 2 different values).

Q. What is the range of values that can be stored in an 'int' data type in C?
-2147483648 to 2147483647
-32768 to 32767
0 to 4294967295
0 to 65535

Explanation:

The range of values that can be stored in an 'int' data type in C is . An 'int' is typically represented as a 32-bit signed integer on most systems, which allows it to store values within this range.

So, the correct answer is:

Q. Which operator is used to compare two values for equality in C?
!=
<>
==
=

Explanation:

The operator used to compare two values for equality in C is . The double equal sign () is the equality operator, and it is used to check if two values are equal to each other.

So, the correct answer is:


Here's an example of using the equality operator in C:


In this example, the program checks if 'x' is equal to 'y' using the operator and prints the result based on the comparison.

Q. What number would be shown on the screen after the following statements of C are executed?
8
5
6
7

Explanation:

Since the ASCII value of G is 71 and the garbage value if A is 65 and hence the difference is 6.

Q. In the following code snippet, character pointer str holds a reference to the string . . . . . . . .
Examveda.com\0programming
Invalid declaration
Examveda.comprogramming
Examveda.com

Explanation:

No explanation is given for this question

Q. Which one of the following is not a reserved keyword for C?
default
auto
case
main

Explanation:

, reserved keywords are words that have predefined meanings and cannot be used as identifiers (such as variable names, function names, etc.).
- This is a reserved keyword in C, used for automatic variables.
- This is a reserved keyword in C, used in switch statements to specify different cases.
- This is not a reserved keyword in C. Although is a commonly used function name for the entry point of a C program, it is not a reserved keyword.
- This is a reserved keyword in C, used in switch statements as a default case.
- This is a reserved keyword in C, used to define register variables for fast access.
Therefore, the correct answer is .

Q. Which header file should be included for input and output functions in C?
<string.h>
<math.h>
<stdlib.h>
<stdio.h>

Explanation:

The header file that should be included for input and output functions in C is . The header file provides declarations for functions like , , , and many others that are used for input and output operations in C.

So, the correct answer is:


Including this header file at the beginning of your C program allows you to use standard input and output functions to interact with the user and manipulate data.

Q. Which library function is used to allocate memory dynamically in C?
realloc
sizeof
free
malloc

Explanation:

No explanation is given for this question

Q. What is the purpose of the 'continue' statement in a loop?
Exit the loop
Skip the loop
Skip the current iteration
Exit the program

Explanation:

The purpose of the 'continue' statement in a loop is to and proceed to the next iteration of the loop. When 'continue' is encountered within a loop, it immediately terminates the current iteration and continues with the next iteration, effectively skipping any remaining code within the current iteration's body.

So, the correct answer is:

Q. What is the significance of the 'volatile' keyword in C?
Allocate memory
Declare a constant
Skip the current iteration
Indicate a volatile variable

Explanation:

No explanation is given for this question

Q. In C, which type of variable should be used to store decimal numbers?
char
double
float
int

Explanation:

In C, you can indeed use the data type to store decimal numbers. However, it's important to note that is typically used for single-precision floating-point numbers, which have a lower precision and a more limited range compared to .

So, to clarify:

If you require high precision and a wide range for storing decimal numbers, is the more common choice.

is a valid choice when you can tolerate slightly lower precision and a somewhat limited range, or when memory constraints are a concern, as typically requires less memory than .

In summary, both and can be used to store decimal numbers, but the choice between them depends on your specific requirements for precision and range.

```