DATA TYPES AND VARIABLES - Converting Data Types

Hello,

I’m stuck at point 2 " Hmm. That didn’t work. Instead, we got the error message:

Looks like we’re going to have to cast their response as an int some other way!

Try explicitly casting the value of faveNumber as an int and rerun the program. What happens this time?"
Link: https://www.codecademy.com/courses/learn-c-sharp/lessons/csharp-data-types-variables/exercises/converting-data-types-csharp

What is the solution please?

Thank you.
Alexandru

Most of the lessons explain how to do certain things in the “Learn” section at the top.

Have a read through it.
For this specific issue, it is explained at the end, from this sentence:
So, if we’re to fix the error in our previous code, we’d rewrite it as follows:

2 Likes