what's the problem here??
When I run this: #include<iostream> using namespace std; int main() { float a=10000, b=10000*0.28, c=10000*0.27, d=3600+b; cout<<"JANUARY 21-->"<<"\t"; cout<<"Basic :"<<a<<"\t"; cout<<"DA :"<<b<<"\t"; cout<<"HRA :"<<c<<"\t"; cout<<"Convance :"<<d<<"\t"; cout<<"Total :"<<a+b+c+d; return 0; } I got answer as : JANUARY 21--> Basic :10000 DA :2800 HRA :2700 Convance :6400 Total :121900 But when I run this I got answer as : #include<iostream> using namespace std; int main() { float a, b=a*0.28, c=a*0.27, d=3600+b; cout<<"Enter the amount :"; cin>>a; cout<<"JANUARY 21-->"<<"\t"; cout<<"Basic :"<<a<<"\t"; cout<<"DA :"<<b<<"\t"; cout<<"HRA :"<<c<<"\t"; cout<<"Convance :"<<d<<"\t"; cout<<"Total :"<<a+b+c+d; return 0; } This is the I have got : Enter the amount :10000 JANUARY 21--> Basic :10000 DA :0 HRA :0 Convance :3600 Total :13600 I don't know why I got different answers. Any one pls explain it.