[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

C Programming :: Basic Concepts - Discussion

Home > C Programming > Basic Concepts > MCQs Questions Discussion

33 / 90

Choose the correct option.

To scan float a and double b, which scanf() statement will be used?

Ascanf("%f%f", &a, &b);

Bscanf("%f%Lf', &a, &b);

Cscanf ("%Lf%Lf', &a, &b);

Dscan{ ("%f%lf', &a, &b);

Answer: Option (Login/Signup)

Show Explanation

Option A is incorrect because it will scan both the variables as float.

Option B is incorrect as here variable b will be scanned as long-double type, but we want b to be double type.

Option C is incorrect because here both the variables will be scanned as long-double type.

Option D is incorrect because it should be 'scanf' and not 'scan{', which will create an error. If we correct this then variable a will be scanned as float type and variable b will be scanned as double type.

Asked In ::

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here