#include<iostream> using namespace std; int main() { float gross ,basic,hra,da; cout<<"enter basic salary of an employee:"; cin>>basic; if(basic<25000) { da=basic*80/100; hra=basic*20/100; } else if(basic>=25000&&basic<40000) { da=basic*90/100; hra=basic*25/100; } else if (basic>40000) { da=basic*95/100; hra=basic*30/100; } gross=basic+hra+da; cout<<"\n\tbasic pay..........."<<basic<<endl; cout<<"\tdearness allowance........."<<da<<endl; cout<<"\thouse rent allowance..........."<<hra<<endl; cout<<"\t----------------------------------"<<endl; cout<<"\tgross salary.................."<<gross<<endl; cout<<"\t-------------------------------------"<<endl; return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter