New course! Every coder should learn Generative AI!
Try a free lesson+ 1
How to get output in decimals in division
2 Answers
+ 19
Use float data type or double for your variable
float a , b, c;
c= a/b;
+ 3
Or type cast them:
int x=3, y=4;
float quot=float(x)/float(y);
cout << quot;