Vidyalelo
C Programming · Q129

Standard Library Functions

Programming · C Programming · question 129

Q129

What will be the output of the following C code if the name entered is "TOM" and time taken to enter this name is 2 seconds? #include #include int main () time_t time1,time2; char get_input [256]; double dif_sec; time (&time1); printf ("Please enter the name of your pet: "); gets (get_input); time (&time2); dif_sec = difftime (time2,time1); printf ("%.2f ", dif_sec ); return 0;

A.
Error
B.
2
C.
2.0
D.
2.00
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board