How to find out what percentage N is of a whole number in C++

1 Answer

0 votes
#include <iostream>

int main() {
    double part = 4800,  whole = 7183;
     
    double percentage = (part / whole) * 100;
     
    std::cout << "percentage = " << percentage << "%";
}


/*
run:
 
percentage = 66.8244%
 
*/

 



answered Dec 17, 2025 by avibootz

Related questions

...