as long as your if statement consists of more than one line, for example (in your code you have e=1.35 and p= 920) you need to put them between curly brackets "{}". You also have another mistake at the end of your code, "return 0;" should come before the curled bracket.
so it should be:
cout<<e<<p;
return 0;
}
Corrected code:
if (liq=="water"||liq=="WATER")
{e=2.15;
p=999.8;}
else if(liq=="oil"||liq=="OIL")
{e=1.35;
p=920;}
else if (liq=="ethy alcohol"||liq=="ETHYL ALCOHOL")
{e=1.06;
p=810;}
else if (liq=="mercury"||liq=="MERCURY")
{e=28.5;
p=13595;}
else
cout<<"pls key in again"<<endl;
cout<<e<<endl<<p;
return 0;
}