MCQs
When an automatic array is partially initialized, the remaining elements are initialized to 0.
Any pointer size is 2 bytes. (only 16-bit offset)
So, char *s1 = 2 bytes.
So, char far *s2 = 4 bytes.
A far pointer has two parts: a 16-bit segment value and a 16-bit offset value.
Since C is a compiler dependent language, it may give different
output in other platforms. The above program works fine in Windows
(TurboC), but error in Linux (GCC Compiler).
2 Errors
1. Type mismatch in redeclaration of fun
2. Type mismatch in parameter aa
Since x < y turns to be TRUE it is replaced by 1. Then 1 < z is compared and to be TRUE. The 1 is assigned to i.
Whenever there is conflict between a local variable and global variable, the local variable gets priority.
fmod(x,y) - Calculates x modulo y, the remainder of x/y.
This function is the same as the modulus operator. But fmod() performs floating point divisions.
#include <stdio.h>
#include <math.h>
int main ()
{
printf ("fmod of 3.14/2.1 is %lfn", fmod (3.14,2.1) );
return 0;
}
Output:
fmod of 3.14/2.1 is 1.040000
extern int a is the declaration whereas int a = 20 is the definition
In case of conflict between local variables the one which is more local gets the priority.
-3 - -3= -3 + 3 = 0
-3 --(-3)= -3 - 3 = -6