1) By default a real number is treated as a
C) long double
In computing, 'real number' often refers to non-complex floating-point numbers.
It includes both rational numbers, such as 42 and 3/4, and irrational numbers such as pi = 3.14159265... When the accuracy of the floating-point number is insufficient, we can use the double to define the number. The double is the same as float but with longer precision and takes double space (8 bytes) than float. To extend the precision further we can use a long double that occupies 10 bytes of memory space.
2) Which of the following expression is equivalent to ++*ptr?
3) The default storage class of a ‘C’ variable is
4) Which header file should be included to use functions like malloc() and calloc()?
5) We can combine the following two statements into one using
p = (char*) malloc(100);
A) char p = *malloc(100);
B) char *p = (char) malloc(100);
C) char *p = (char*)malloc(100);
D) char *p = (char *)(malloc*)(100);
6) How many times "DOEACC" will get printed?
for(x=-1; x<=10; x++)
if(x < 5)
A) Infinite times
B) 11 times
C) 0 times
D) 10 times
7) Which of the following statement is correct about the following program?
long fun(int num)
for(i=1; i<=num; i++)
f = f * i;
A) The function calculates the value of 1 raised to power num
B) The function calculates the square root of an integer
C) The function calculates the factorial value of an integer
D) None of the above
8) In C, if you pass an array as an argument to a function, what actually gets passed?
A) Value of elements in array
B) First element of the array
C) Base address of the array
D) Address of the last element of array
9) If a file is open in ‘write’ mode, then
A) If it does not exist, an error is returned
B) If it does not exist, it is created
C) If it exists, then data is written at the end
D) If it exists, error is returned
10) Which of the following functions is used to free the allocated memory?