C++ has three different float types : float, double and long double. This program shows the implementation of these data types. In the next program, operations are performed on these float data types.
#include<iostream>
using namespace std;
int main(){
float x = 10.5f;
double d = 22.5;
long double l = 32.5;
cout<<"x = "<<x<<endl;
cout<<"d = "<<d<<endl;
cout<<"l = "<<l<<endl;
return 0;
}

Operations on floating-type arithmetic
#include<iostream>
using namespace std;
int main(){
double x = 32.5;
double y = 45.3;
cout<<"x = "<<x<<" y = "<<y<<endl;
cout<<"x + y = "<<x+y<<endl;
cout<<"x - y = "<<x-y<<endl;
cout<<"x * y = "<<x*y<<endl;
cout<<"x / y = "<<x/y<<endl;
return 0;
}

% operator does not work on float types.