10.0 would be interpreted as floating point : Float « Data Type « C++






10.0 would be interpreted as floating point

10.0 would be interpreted as floating point
 

#include <iostream>
using namespace std;
int main(void)
{
   float firstOp = 10, result;
   int secondOp = 4;
   result = firstOp / secondOp;
   cout << firstOp << " / " << secondOp << " = " << result;
   return 0;
}


           
         
  








Related examples in the same category

1.Make the result of integer division a floatMake the result of integer division a float
2.Enter hexadecimal digits and a floating-point numberEnter hexadecimal digits and a floating-point number
3.cin to read float in C++cin to read float in C++
4.Float value pointer and int value pointerFloat value pointer and int value pointer
5.Demonstrates the definition and use of references.Demonstrates the definition and use of references.
6.Return float type from function
7.Get the square and cube of a float type number