What will be the output of the following C code? [code]#include <stdio.h> #include <time.h> int main () { double d; d = difftime (5,17); prin

What will be the output of the following C code?
Code:
#include <stdio.h>
#include <time.h>
int main ()
{
	double d;
	d = difftime (5,17);
	printf ("%.2f\n", d );
	return 0;
}
A. 12.00
B. -12.00
C. Error
D. 12
 
Answer: b
Explanation: The library function difftime(time1,time2) is used to find the difference between time1 and time2 such as: time1-time2. Hence the output of the code shown above will be 5-17=12.00.
 

Tìm kiếm

Back
Top