Question 1
In the context of modulo operation (i.e. remainder on division) for floating point (say 2.1 and 1.1), pick the best statement.
For floating point, modulo operation isn't defined and that's why modulo can't be found.
(2.1 % 1.1) is the result of modulo operation.
fmod(2.1,1.1) is the result of module operation.
((int)2.1) % ((int)1.1) is the result of modulo operation.
Question 2
Question 3
Question 4
i) printf("%d",8);
ii) printf("%d",090);
iii) printf("%d",00200);
iv) printf("%d",0007000);
Question 5
In the context of the below program snippet, pick the best answer.
#include <stdio.h>
int arr[10][10][10];
int main()
{
arr[5][5][5] = 123;
return 0;
}
Which of the given printf statement(s) would be able to print arr[5][5][5]
(i) printf("%d",arr[5][5][5]);
(ii) printf("%d",*(*(*(arr+5)+5)+5));
(iii) printf("%d",(*(*(arr+5)+5))[5]);
(iv) printf("%d",*((*(arr+5))[5]+5));
only (i) would compile and print 123.
both (i) and (ii) would compile and both would print 123.
only (i), (ii) and (iii) would compile but only (i) and (ii) would print 123.
only (i), (ii) and (iii) would compile and all three would print 123.
all (i), (ii), (iii) and (iv) would compile but only (i) and (ii) would print 123.
all (i), (ii), (iii) and (iv) would compile and all would print 123.
There are 5 questions to complete.