Got a C in a class and retook it and got a B

Hello
I retook a class in my high school which I got a C in the first time and then I retook it and Got a B.
So my question is when applying to college next year will UC/ CSU take My B or both?

Both. I retook a class that I got a D in. I input both grades. The D and the A from retaking the class. They’re both in your official transcript and they see that so if you don’t input the D grade too, it’ll look like you’re trying to hide it from them.

So when they calculate my Gpa will they count both ?

http://admission.universityofcalifornia.edu/counselors/q-and-a/calculating-gpa/index.html#9

generally, you can replace a D or F by retaking the course. A C won’t qualify for the same treatment. I believe they ignore the slightly higher B.