float into int

Jan 4, 2016 at 2:13pm

can anyone help me out with converting a float into integer. I'm new here...
1
2
3
 	cin>>a>>b>>c>>d>>e;
	f=(a+b+c+d+e)/5;
	cout<<f;

so i come here and i need to convert f from float to int (f is unknown) and compare it to rest of the numbers to see which one is the closest one.
Last edited on Jan 4, 2016 at 5:46pm
Jan 4, 2016 at 2:58pm
Jan 4, 2016 at 5:47pm
thank you :)
Topic archived. No new replies allowed.