Problem with calculations

This program should allow you to enter the percentage desired

at the end of a course, the total number of points in the

course, the points earned to date, and the total points to

date. The program should then calculate and display:

1) the number of the remaining points in the class needed to

earn the desired percentage

2) the percentage of the remaining points needed to earn the

desired percentage in the course.

Read the input in the order below: (Don't read anything else.)

1) Percentage desired

2) Total points in the course

3) Points earned to date

4) Total points to date

Heres is what I have got so far. I am not sure how to convert the formula over to C code

#include <stdio.h>

int main ()

{

float percent;

int totalpoints;

int earnedpoints;

int totaltodate;

printf("Enter Percentage Desired:");

scanf (" %d", & percent);

printf("Enter Total points in the course:");

scanf ("%d",& totalpoints);

printf("Enter Total points earned to date:");

scanf("%d ", &earnedpoints);

printf("Enter Total points to date:");

scanf("%d",&totaltodate);