Home » Aptitude Questions and Answers » C# Aptitude Questions and Answers

C# Data types Aptitude Questions and Answers

This section contains aptitude questions and answers on C# data types Aptitude Questions and Answers.

1) "int" is an alias of _________.
  1. System.Int16
  2. System.Int32
  3. System.Int64
  4. System.Byte

2) "char" is an alias of _________.
  1. System.Char
  2. System.String
  3. System.Text
  4. Character

3) A "byte" type variable stores the value between the range of ________.
  1. -128 to +127
  2. 0 to 127
  3. 0 to 255
  4. 0 to 256

4) A "sbyte" type variable stores the value between the range of ________.
  1. -128 to +127
  2. 0 to 127
  3. 0 to 255
  4. 0 to 256

5) What will be the output of the following program?
static void Main(string[] args)
{
	byte a = 10;
	byte b = 20;
	byte sum = a + b;
	Console.WriteLine(sum);
}
  1. 30
  2. Compilation error
  3. Run time error
  4. None

6) What will be the output of the following program?
static void Main(string[] args)
{
	sbyte a = -10;
	sbyte b = 20;
	sbyte sum = a + b;
	Console.WriteLine(sum);
}
  1. 10
  2. Compilation error
  3. Run time error
  4. None






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL







Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.