🎴 Flashcard Mode

C Programming Fundamentals

Card1 / 15
Mastered0
Review0
QuestionClick to flip

Which is the actual syntax to find the ratio of boys and girls in C language? (given that float ratio; int boys, girls;)

AnswerClick to flip back
A
ratio = (float) boys/girls;
💡 Explanation:

Cast operator is required to convert the boys/girls calculation in decimal precision. Cast operator can be used to explicitly convert the value of an expression to a different data type.

Change Mode