What to do (C++) to get a fractional value? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

What to do (C++) to get a fractional value?

For example: int not_Fraction = 23/5; cout << not_Fraction; return 0; This prints only the whole number and avoids any remainder. But what do i need to do get the value in fraction?

3rd Oct 2019, 4:09 PM
Samiul Nasif Tayem
Samiul Nasif Tayem - avatar
1 Réponse
+ 1
use float or double instead of int
3rd Oct 2019, 4:12 PM
Taste
Taste - avatar