×

C# Tutorial

Basics of .Net

C# Basics

C# Fundamentals

C# Operators

C# Loops

C# Type Conversions

C# Exception Handling

C# String Class

C# Arrays

C# List

C# Stack

C# Queue

C# Collections

C# Character Class

C# Class and Object

C# Namespaces

C# Delegates

C# Constructors

C# Inheritance

C# Operator Overloading

C# Structures

C# File Handling

C# Convert.ToInt32()

C# Int32 (int) Struct

C# DateTime Class

C# Uri Class

C# Database Connectivity

C# Windows

C# Other Topics

C# Q & A

C# Programs

C# Find O/P

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



Advertisement
Advertisement


Comments and Discussions!

Load comments ↻


Advertisement
Advertisement
Advertisement

Copyright © 2025 www.includehelp.com. All rights reserved.