Question
10. We are trying to assign the value of a variable named FirstNumber to a variable named SecondNumber. They are declared as shown below. Which
10. We are trying to assign the value of a variable named "FirstNumber" to a variable named "SecondNumber". They are declared as shown below. Which of the following statements is correct?
double FirstNumber = 25.5;
int SecondNumber;
b. SecondNumber = (double) FirstNumber;
a. SecondNumber = (int)FirstNumber;
d. SecondNumber = double.Parse (FirstNumber);
c. SecondNumber = int.Parse (FirstNumber);
11. Which of the following C# statements displays the following message "your Score is 28":
(note that Score is an integer variable holding the value of 28)
int Score =28;
a. MessageBox.Show = "Your Score is " + "Score";
b. MessageBox.Show = "Your Score is" + Score;
c. MessageBox.Show ("Your Score is" + "Score");
d. MessageBox.Show ("Your Score is" + Score);
13. which of the following statements is correct?
double userID=25.87;
a. int userNumber =(double) userID;
b. int userNumber = toString(userID);
d. int userNumber = userID;
c. int userNumber = 2* (int) userID;
33. Briefly Explain the following conversion methods:
- Cast Operators
- Parsing Methods
- .ToString() Methods
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started