Which of the conversions are valid for the following C# code? static void Main(string[] args) {
View Question
What will be the output of the following C# code?
static void Main(string[] args)
{
float sum;
int i;
sum = 0.0F;
for (i = 1; i <= 10; i++)
{
sum = sum + 1 /(float)i;
}
Console.WriteLine(“sum =” +sum);
Console.ReadLine();
}
What will be the output of the following C# code? static void Main(string[] args) { ...
View Question
For the given set of C# code, is conversion possible?
static void Main(string[] args)
{
int a = 76;
char b;
b = (char)a;
Console.WriteLine(b);
Console.ReadLine();
}
For the given set of C# code, is conversion possible? static void Main(string[] args) { ...
View QuestionDisadvantages of Explicit Conversion are?
a) Makes program memory heavier b) Results in loss of data c) Potentially Unsafe d) None of the mentioned
View QuestionType of Conversion in which compiler is unable to convert the data type implicitly is?
a) ushort to long b) int to uint c) ushort to long d) byte ...
View QuestionThe subset of ‘int’ data type is __________
a) long, ulong, ushort b) long, ulong, uint c) long, float, double d) long, float, ushort Answer: c Explanation: ...
View Question
For the following C# code select the relevant solution for conversion of data type.
static void Main(string[] args)
{
int num1 = 20000;
int num2 = 50000;
long total;
total = num1 + num2;
Console.WriteLine(“Total is : ” +total);
Console.ReadLine();
}
For the following C# code select the relevant solution for conversion of data type. static void Main(string[] ...
View QuestionImplicit Conversion’ follows the order of conversion as per compatibility of data type as:
a) float < char < int b) char < int < float c) int < char < float d) float ...
View QuestionTypes of ‘Data Conversion’ in C#?
a) Implicit Conversion b) Explicit Conversion c) Implicit Conversion and Explicit Conversion d) None of the mentioned Answer: b
View QuestionWhat is the need for ‘Conversion of data type’ in C#?
a) To store a value of one data type into a variable of another data type b) To get desired ...
View Question