Floating number confusion

if i write a command:
float y=1/5;
cout<<y;
why the output is comming 0 and not 0.2.
whazt should i do to get 0.2.

hey @angivanshikaangi, it is because 1 and 2 are of int type, and int /int give int only. Write 1 or 2 or both in decimal form (1.0 2.0),than it will give 0.2 only.