What will be the output of the following C++ code?
#include <stdio.h>
#include <stdlib.h>
int main ()
{
char s[] = "365.24 29.53";
char* p;
double d1, d2;
d1 = strtod (s, &p);
d2 = strtod (p, NULL);
printf ("%.2f\n", d1/d2);
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main ()
{
char s[] = "365.24 29.53";
char* p;
double d1, d2;
d1 = strtod (s, &p);
d2 = strtod (p, NULL);
printf ("%.2f\n", d1/d2);
return 0;
}
A. 12
B. 12.37
C. 13
D. 15
Answer: Option B
Join The Discussion