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

1 Answer

0 votes
#include <stdio.h>

int main() {
    double part = 4800,  whole = 7183;
    
    double percentage = (part / whole) * 100;
    
    printf("percentage = %.2lf%", percentage);

    return 0;
}


/*
run:

percentage = 66.82

*/

 



answered Dec 17, 2025 by avibootz
...