C++ Program for Float and Double Data Type
Master C++ with Real-time Projects and Kickstart Your Career Start Now!!
Program 1
#include<iostream>
#define clrscr() system("cls")
using namespace std;
int main()
{
clrscr();
cout<<"15/2: "<<15/2<<endl;
cout<<"15.0/2: "<<15.0/2<<endl;
cout<<"15/2.0: "<<15/2.0<<endl;
cout<<"15.0/2.0: "<<15.0/2.0<<endl;
// int h,e,c,m,total;
// float per;
// clrscr();
// cout<<"Enter marks of 4 subject";
// cin>>h>>e>>c>>m;
// total=(h+e+c+m);
// cout<<"\nTotal Marks : "<<total;
// per=total/4.0;
// cout<<"\nPercentage: "<<per;
// return 0;
}Program 2
#include<iostream>
#define clrscr() system("cls")
using namespace std;
int main()
{
float r,A,C;
const float PI=3.14f;
clrscr();
cout<<"\nEnter redious of circle";
cin>>r;
A=PI*r*r;
C=2*PI*r;
cout<<"Area is : "<<A;
cout<<"\nCircumfrance is : "<<C;
return 0;
}
Your 15 seconds will encourage us to work even harder
Please share your happy experience on Google

