A student sold candy bars and bags of popcorn for a school fund-raiser.

The student sold a total of 240 candy bars and bags of popcorn.
The price of each candy bar was $1, and the price of each bag of popcorn was $2.
The student sold $300 worth of candy bars and bags of popcorn.
How many candy bars did this student sell for the school fun-raiser?
A. 80
B. 60
C.180
D. 120

Let's assume the student sold x candy bars.

So, the student sold (240 - x) bags of popcorn.

The total amount received from selling candy bars is x * $1 = $x.
The total amount received from selling bags of popcorn is (240 - x) * $2 = $2(240 - x) = $480 - $2x.

The total amount received from selling candy bars and bags of popcorn is $300.

Therefore, we have the equation: $x + ($480 - $2x) = $300.

Simplifying the equation, we get: $480 - $x = $300.

By solving for x, we have: $480 - $300 = $x.

So, $180 = $x.

Hence, the student sold 180 candy bars for the school fund-raiser.

The correct answer is C. 180.