Percent in c++?

Hi, I want to calculate percent of 100 in C++.

For example, I'm making a progress bar, how would I make it so
number = 5
total = 10
percent = 50
2 answers