Sail E0 Webinar
Question


To scan a and b given below, which of the following scanf() statement will you use?


#include<stdio.h>
float a;
double b;
Options:
A .  gets()
B .  fgets()
Answer: Option B

To scan a float value, %f is used as format specifier.

To scan a double value, %lf is used as format specifier.

Therefore, the answer is scanf("%f %lf", &a, &b);



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers