51. Storage location used by computer memory to store data for usage by an application is?
52. For two strings s1 and s2 to be equal, which is the correct way to find if the contents of two strings are equal?
53. What will be the output of the following C# code?
int a,b;
a = (b = 10) + 5;
int a,b;
a = (b = 10) + 5;
54. Which Conversion function of 'Convert.TOInt32()' and 'Int32.Parse()' is efficient?
i. Int32.Parse() is only used for strings and throws argument exception for null string
ii. Convert.Int32() used for data types and returns directly '0' for null string
i. Int32.Parse() is only used for strings and throws argument exception for null string
ii. Convert.Int32() used for data types and returns directly '0' for null string
55. 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();
}
static void Main(string[] args)
{
int a = 76;
char b;
b = (char)a;
Console.WriteLine(b);
Console.ReadLine();
}
56. Correct way to define a value 6.28 in a variable 'pi' where value cannot be modified?
57. Correct way to assign values to variable 'c' when int a=12, float b=3.5, int c;
58. Correct statement about strings are?
59. What will be the output of the following C# code?
public static void Main(string[] args)
{
int i = 546;
object o = i;
int n =(int) o;
o = 70;
System. Console. WriteLine("The value-type value = {0}", n);
System. Console. WriteLine("The object-type value = {0}", o);
Console. ReadLine();
}
public static void Main(string[] args)
{
int i = 546;
object o = i;
int n =(int) o;
o = 70;
System. Console. WriteLine("The value-type value = {0}", n);
System. Console. WriteLine("The object-type value = {0}", o);
Console. ReadLine();
}
60. What will be the output of the following C# code?
static void Main(string[] args)
{
float a = 10.553f;
long b = 12L;
int c;
c = Convert.ToInt32(a + b);
Console.WriteLine(c);
}
static void Main(string[] args)
{
float a = 10.553f;
long b = 12L;
int c;
c = Convert.ToInt32(a + b);
Console.WriteLine(c);
}
Read More Section(Basic Syntax and Data Types in C Sharp)
Each Section contains maximum 100 MCQs question on Basic Syntax and Data Types in C Sharp. To get more questions visit other sections.