Question: C# Help 1.Which primitive type can hold the largest value? long double float int 2. What is the message that will be printed out after

C# Help

1.Which primitive type can hold the largest value?

long
double
float

int

2. What is the message that will be printed out after executing the following code ?

int x= 2 ,y = 6; if (x>3 && y>=6) Console.WriteLine("Class 1"); else if (x>2 || y>=6) Console.WriteLine(" Class 2");

else

Console.WriteLine(" Class 3");

3. Methods that call themselves are known as recursive methods.

True

False

4.What is the message that will be printed out after executing the following code ?

int x= 2 ,y = 6; if (x>3 && y>=6) Console.WriteLine("Class 1"); else if (x>2 || y>=6) Console.WriteLine(" Class 2");

else

Console.WriteLine(" Class 3");

5. Methods must return at least one value.

True

False

6. Let x be a double. How can you typecast a double into an int? ________

7.Consider the following segment of the code:

int sum=5; for (int n= 1; n< 8;n++) if(n!=5) sum =sum + n;

What is the is the value of sum?

8. Consider the following segment of the code:

int j=5 ,i=8; while (i<10 || j>1) { i++; j--; }

How many times does the loop execute?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!