Govt. Exams
Entrance Exams
Binary search divides the search space in half with each iteration, resulting in logarithmic time complexity O(log n).
3NF removes transitive dependencies where a non-key attribute depends on another non-key attribute. BCNF is stricter but 3NF is the standard answer for eliminating transitive dependencies.
The printf() function is defined in the Standard Input/Output library. Therefore, '#include <stdio.h>' must be included at the beginning of the program to use printf() and other I/O functions like scanf(), getchar(), putchar(), etc.
The strlen() function returns the number of characters in a string, excluding the null terminator ('\0').
int main() {
int a = 10;
printf("%d", a += 5);
return 0;
}
The += operator adds 5 to a (a = a + 5 = 10 + 5 = 15), and printf prints the updated value 15.
In C, array indices are 0-based. arr[1][2] refers to the element in the second row (index 1) and third column (index 2) of the 2D array.
getchar() reads a single character from standard input (stdin). While fgetc() can also read a character, getchar() is the standard dedicated function for this purpose.
The correct syntax is 'int *p;' where int is the data type, * indicates pointer, and p is the pointer variable name.
The asterisk (*) symbol is used to declare pointer variables. For example: int *ptr; declares a pointer to an integer.