Question: Identify the bug in the following program. int main ( void ) { float miles, / * input - distance in miles. * / kms;

Identify the bug in the following program.
int
main(void)
{ float miles,/* input - distance in miles.*/
kms;/* output - distance in kilometers*/
/* Get the distance in miles. */
printf("Enter the distance in miles>");
scanf("%lf", &miles);
/* Convert the distance to kilometers. */
kms = KMS_PER_MILE * miles;
/* Display the distance in kilometers. */
printf("That equals %f kilometers.
", &kms);
return (0);
}
Group of answer choices
"float" is not a legal data type
the "main" function returns type int so the "return(0)" is not correct since 0 is not an int
the "&" in the scanf statement should not be there
the "&" in the printf statement should not be there

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!