Examveda
Examveda

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;
}

A. 12

B. 12.37

C. 13

D. 15

Answer: Option B


Join The Discussion

Related Questions on Standard Template Library (STL) in C plus plus