Hi all I'm new to the forum and new to C++. I have a problem that I solved but could not round it to a whole number as required. Can someone please help? I'd really appreciate it.
//This program calculates the number of slices in a pizza... Get the diameter in inches.
cout << "What is the diameter of the pizza in inches? ";
cin >>diameterInInches;
// calculate number of slices.
cout << "The number of slices in this pizza are: ";
radius = diameterInInches / 2;
area = 3.14 * pow(radius, 2);
numberOfSlices = area / 14.125;
I'm not sure how to use the code. I tried a few different options and failed. I provided the code above so that someone can incorporate "round up" into it, so that I can study what they did to the code and learn from it.