+ 2
Help about C language
If the result of an integer division, where both the numerator and the denominator are integers, is a fraction, the fractional part is____?
20 Answers
+ 3
"the fractional part is..."
... obtained by using the modulus operator, % and doing floating point divide of the denominator.
Or in decimal, by performing the division in floating point and using the frac() library function.
+ 2
truncated? There could be many different answers...
+ 2
It depends on data types you are storing the division result
+ 2
Shoug Souliman , so correct answer is
"rounded down to the nearest integer"
+ 2
Eashan Morajkar , yes. So? It's incomplete answer to his question.
+ 2
During an integer and an integer division the fractional part is removed
+ 2
Eashan Morajkar yup, this will also be a correct answer...
+ 2
Brian The fractional part are the numbers at the right of the decimal point
e.g
2.31
Fractional part = 31
Its the part gotten by subtracting the integer part of number by the number
+ 2
To get only the fractional part in C:
num-((int) num)
+ 2
akshay atugade , please post your question in a new thread rather than posting it here...
+ 2
The division of both integer will result in integer division.if you want the result in fraction Define the denominator as fraction value.
Eg: 5/5=1
5/5.0=1 0
+ 2
Rishi , did he delete his answer or you just posted this in the wrong thread?
+ 2
Aleksei Radchenkov lol he deleted his answer
His answer: I will help you I got the answer, just follow my account *his account link*
But the person I tagged is right, he did that I'm sure😂
+ 2
Shoug Souliman its answer depends upon the data type in which you are storing the fractional value. If you store in integer data type then it give always the integer value, and same will be in the case of float but in float case you will get the the integer value with append zero only(will not give the exact fractional Result).
+ 1
Shoug Souliman, if you put the division result inside int or if you print it, the result will be rounded down to the nearest integer.
+ 1
Eashan Morajkar , this is just a single case... It doesn't mean any division will result in 0. For example if you divide 5/3 it will result in 1, so as I said it will be rounded down.
+ 1
Even if you change division to int data type, the output will be 0, which means the fractional part is also 0
+ 1
Aleksei Radchenkov But the fractional part is still 0
+ 1
How to convert input string into the list...
How to calculate each letter letter in string.
eg. Hi hello
So returns 7 letters
+ 1
The fractional part is lost