Compression ratio, Compression factor, saving percentage in C++

#include<iostream.h>
#include<conio.h>
void main()
{
float ori,aft;
float CR,CF,SP;
clrscr();
cout<<"\nEnter the size of the source file : ";
cin>>ori;
cout<<"\nEnter the size of the compressed file : ";
cin>>aft;
CR=aft/ori;
CF=ori/aft;
SP=((ori-aft)/ori)*100;
cout<<" Compression Ratio = "<<CR;
cout<<"\n Compression Factor = "<<CF;
cout<<"\n Saving percentage = "<<SP<<" %";
getch();
}

Comments

Popular posts from this blog

Silde show of images In JSP

Working with database in Vb.net