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

C# Basic Input/output Aptitude Questions and Answers

This section contains aptitude questions and answers on C# Basic Input/output Aptitude Questions and Answers.

1) What will be the output of following program?
static void Main(string[] args)
{
	int a = 10, b = 20;
	Console.WriteLine("{0},{0}", a, b);
}
  1. 10,10
  2. 10,20
  3. 20,20
  4. 20,10

2) What will be the output of following program?
static void Main(string[] args)
{
	int a = 10, b = 20;
	Console.WriteLine("{0}+{1}", a, b);
}
  1. 30
  2. 20+20
  3. 10+10
  4. 10+20

3) What will be the output of following program?
static void Main(string[] args)
{
	Console.WriteLine(Console.Write("Hello"));
}
  1. Error
  2. 6Hello
  3. Hello6
  4. Hello5

4) What will be the output of following program?
static void Main(string[] args)
{
	int a = 10, b = 10;
	Console.WriteLine(a == b);
}
  1. 1
  2. a==b
  3. True
  4. true

5) What will be the output of the following program, if the input is "Hello world!"?
static void Main(string[] args)
{
	string text = "";
	text = Console.ReadLine();
	Console.WriteLine(text);
}
  1. Hello
  2. Hello world!
  3. Helloworld!
  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.