Welcome to the Data Types,Variables and Operators MCQs Page
Dive deep into the fascinating world of Data Types,Variables and Operators with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Data Types,Variables and Operators, a crucial aspect of C# Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Data Types,Variables and Operators, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C# Programming.
Check out the MCQs below to embark on an enriching journey through Data Types,Variables and Operators. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C# Programming.
Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Data Types,Variables and Operators. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!
Data Types,Variables and Operators MCQs | Page 7 of 14
Explore more Topics under C# Programming
public static void Main(string[] args)
{
double ZERO = 0;
Console.WriteLine("RESULT OF DIVISION BY ZERO IS :{0}", (0 / ZERO));
Console.ReadLine();
}
static void Main(string[] args)
{
char c = 'g';
string s = c.ToString();
string s1 = "I am a human bein" + c;
Console.WriteLine(s1);
Console.ReadLine();
}
static void Main(string[] args)
{
var days = "MTWTFSS";
var daysArray = days.ToCharArray().Cast<string>().ToArray();
for (var i = 0; i < daysArray.Length; i++)
{
switch (daysArray[i])
{
case "M":
daysArray[i] = "Monday";
break;
case "T":
daysArray[i] = "Tuesday";
break;
case "W":
daysArray[i] = "Wednesday";
break;
case "R":
daysArray[i] = "Thursday";
break;
case "F":
daysArray[i] = "Friday";
break;
case "S":
daysArray[i] = "Saturday";
break;
case "U":
daysArray[i] = "Sunday";
break;
}
}
daysArray[daysArray.Length - 1] = "and " + daysArray[daysArray.Length - 1];
Console.WriteLine(string.Join(", ", daysArray));
}
static void Main(string[] args)
{
{
var dayCode = "MTWFS";
var daysArray = new List<string>();
var list = new Dictionary<string, string>
{ {"M", "Monday"}, {"T", "Tuesday"}, {"W", "Wednesday"},
{"R", "Thursday"}, {"F", "Friday"}, {"S", "Saturday"},
{"U", "Sunday"}
};
for (int i = 0,max = dayCode.Length; i < max; i++)
{
var tmp = dayCode[i].ToString();
if (list.ContainsKey(tmp))
{
daysArray.Add(list[tmp]);
}
}
Console.WriteLine(string.Join("\n ", daysArray));
}
Tuesday
Wednesday
Friday
Saturday
1. varchar is non unicode and char is unicode character datatype
2. char is βnβ bytes whereas varchar is actual length in bytes of data entered in terms of storage size
3. varchar is variable in length and char is the fixed length string
4. For varchar, if a string is less than the maximum length then it is stored in verbatim without any extra characters while for char if a string is less than the set length it is padded with extra characters to equalize its length to given length
static void Main(string[] args)
{
string s1 = "Delhi";
string s2;
s2 = s1.Insert (6, "Jaipur");
Console.WriteLine(s2);
}
c = s1.CompareTo(s2);
Suggested Topics
Are you eager to expand your knowledge beyond C# Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!