0
Can we have fraction entry in c++ ( for ex 5/11)
2 Respuestas
+ 1
Aryan treat it as string and manipulate accordingly.... directly as digits you can not store it... also you can have class which has two different variable of type int to store 5 and 11
0
Hi
Using a class would be a sophisticated way of doing it. It could include operation overloads, comparison, and other things that you would want to do with it.
Probably a struct or typedef would do to simply keep the values.
Hope this helps. Cheers. C.