Anda di halaman 1dari 7

2/25/2015

C# Questions & Answers Integer Data Types | Sanfoundry

Home

About

Jobs

Contact

C-Tutorials

Courses | Fees | Dates

C-MCQs

Computer-Science-MCQs

C++MCQs
C-Programs

College-Projects

Java-MCQs

C#MCQs

Testimonials

Linux-MCQs

Internship

Developers

SAN-MCQs

Best-Books

C# Questions & Answers Integer


Data Types

SAN I - Technology Training

Advertisements

ONE BILLION STRONG

Best Training
Courses
SAN II - Administration Training
Linux Fundamentals/Administration

Hover to Expand

Advanced C Programming
Linux-C Debugging Techniques
Linux System Programming

This section of our 1000+ C# multiple choice questions focuses on


various data types in integer in C# Programming Language.

Linux IPCs Programming


Linux Network Programming
Linux Multithreaded Programming

1. How much Bytes are stored by Long Datatype in C# .net?


a) 8
b) 4
c) 2
d) 1
View Answer
2. Choose .NET class name from which datatype UInt is derived of?
a) System.Int16
b) System.UInt32
c) System.UInt64
d) System.UInt16
View Answer
3. Correct Declaration of Values to variables a and b?
a) int a = 32, b = 40.6;
b) int a = 42; b = 40;
c) int a = 32; int b = 40;
d) int a = b = 42;
View Answer

Linux Kernel Programming


Linux Kernel Debugging
Advertise Here

Device Driver
Trainings
Linux Device Drivers Basics
Linux Block Device Drivers
Linux Network Device Drivers
Linux PCI Device Drivers
Linux USB Device Drivers
Linux Video Device Drivers
Linux Audio Device Drivers
Linux I2C Device Drivers

Advertisements

4. Select error in a given program :


1.

Static Void Main(String[] args)

http://www.sanfoundry.com/csharp-mcqs-integer-data-types/

1/7

2/25/2015

C# Questions & Answers Integer Data Types | Sanfoundry

2.

3.

const int m = 100;

4.

int n = 10;

5.

const int k = n / 5 * 100 * n ;

6.

Console.WriteLine(m * k);

7.

Console.ReadLine();

8.

a) k should not be declared constant


b) Expression assigned to k should be constant in nature
c) Expression (m * k) is invalid
d) m is declared in invalid format
View Answer
5. Arrange following datatype in order of increasing magnitude sbyte,
short, long, int.
a) long < short < int < sbyte
b) sbyte < short < int < long
c) short < sbyte < int < long
d) short < int < sbyte < long
View Answer
6. Which datatype should be more preferred for storing a simple number
like 35 to improve execution speed of a program?
a) sbyte
b) short
c) int
d) long
View Answer

Technical Career
Developer Tracks

7. Which Conversion function of Convert.TOInt32() and Int32.Parse()


is efficient?
1) Int32.Parse() only used for strings and throws arguement exception
for null string
2) Convert.Int32() used for datatypes and returns directly 0 for null
string
a) 2
b) Both 1,2
c) 1
d) None of the mentioned
View Answer

SAN Developer
Linux System Developer
Linux Kernel/Driver Developer
Linux Network Developer
Mentoring
Productivity
Coding-Style
GDB Assignment
Feedback

Advertisements

8. Correct way to assign values to variable c when int a=12, float


b=3.5,int c;
a) c = a + b;
http://www.sanfoundry.com/csharp-mcqs-integer-data-types/

2/7

2/25/2015

C# Questions & Answers Integer Data Types | Sanfoundry

b) c = a + int(float(b));
c) c = a + convert.ToInt32(b);
d) c = int(a + b);
View Answer
9. Correct Set of Code for given data a and b to print output for c as
74 ?
a)

1.

int a = 12;

2.

float b = 6.2f;

3.

int c;

4.

c = a / b + a * b;

5.

Console.WriteLine(c);

1000 C# MCQs |
Quiz
Integer Data Types
Floating and Decimal Data Types

b)

Char Types and String Literals


Initialization of Variables

1.

int a = 12;

2.

float b = 6.2f;

3.

int c;

4.

c = a / convert.ToInt32(b) + a * b;

5.

Console.WriteLine(c);

Scope and Lifetime of Variables


Type Conversion in Expressions
Arithmetic Operators
Relational and Logical Operators
Bit-wise and Conditional Operators
IF Statements
Switch Statements
For Loop Statements

c)

While Loop Statements


Do While Loop Statements

1.

int a = 12;

2.

float b = 6.2f;

3.

int c;

4.

c = a / convert.ToInt32(b) + a * convert.ToInt32(b);

5.

Console.WriteLine(c);

Continue, Goto statements


Fundamentals of Class
Reference Variables and Assignment
Methods in Class
Constructors in Class
Destructors in Class
Array and Initialization
Basic Operation on Strings
String Class with Description

d)

Comparison of Strings
Searching and Modifying Strings

1.

int a = 12;

2.

float b = 6.2f;

3.

int c;

4.

c = convert.ToInt32(a / b + a * b);

5.

Console.WriteLine(c);

Operation on Characters
Public & Private Access Modifier
Use of Ref and Out Parameters
Use of Variable Arguements
Polymorphism
Structures
Enumerations

http://www.sanfoundry.com/csharp-mcqs-integer-data-types/

3/7

2/25/2015

C# Questions & Answers Integer Data Types | Sanfoundry

View Answer

Fundamentals of Inheritance
Inheritance Implementation

10) Is output remain same or different for both cases?

Method Overloading

1)

Method Overriding
Constructor Overloading

1.

char l ='k';

2.

float b = 19.0f;

3.

int c;

4.

c = (l / convert.ToInt32(b));

5.

Console.Writeline(c);

Abstract Class & Methods


Introduction of Overloaded Operators
Recursion
Introduction of Indexers
Introduction of Properties
Properties and its Applications
Interfaces Introduction
Interfaces Implementation
Fundamentals of Exception Handling

2)

Implementation of Exception Handling


Exceptions of Type Finally and Built in

1.

char l ='k';

2.

float b = 19.0f;

3.

int c;

4.

c = Convert.ToInt32(l / b);

Reading Console Input Operations

5.

console.writeline(c);

Writing Console Output Operations

Try & Catch in Detail


Attributes
Introduction of Console I/O Operations

Introduction of Stream Classes


Byte Stream

a) Yes

Character Stream

b) No
View Answer

Fundamental of Delegates
Delegates in Detail
Events

11. Default Type of number without decimal is ?


a) Long Int
b) Unsigned Long
c) Int
d) Unsigned Int

Fundamental of Generics
Generic Methods
Fundamental of LINQ
Operation and Query with LINQ
Introduction of Reflections
Collection Classes

View Answer

Maths Class

12. Correct output for code is?

Rounding Functions in C#
Math Methods
Multi-threaded Programming - 1

1.

static void Main(string[] args)

Multi-threaded Programming - 2

2.

Iterators

3.

float a = 10.553f;

Fundamentals of Namespaces

4.

long b = 12L;

Fundamentals of Preprocessors

5.

int

Method with Parameters

6.

c = Convert.ToInt32(a + b);

Fundamental of Networking

7.

Console.WriteLine(c);

URI class

8.

c;

Network Errors Handling


Type Interface
Unsafe Code & Pointers Basics

http://www.sanfoundry.com/csharp-mcqs-integer-data-types/

4/7

2/25/2015

C# Questions & Answers Integer Data Types | Sanfoundry

a) 23.453

Pointers Operation - 1

b) 22
c) 23
d) 22.453

Pointers Operation - 2
Accessor Controls of Class
Introduction of String Formatting

View Answer

String Formatting - 1
String Formatting - 2

Sanfoundry Global Education & Learning Series C# Programming


Language.

Follow Manish & Sanfoundry

Heres the list of Best Reference Books in C# Programming Language.

Follow

1.2k

To practice all features of C# programming language, here is complete


set on 1000+ Multiple Choice Questions and Answers on C#.

Follow

1.5k

Subscribe to Sanfoundry
0
Tweet

Answer

Answering

How to use twitter

Net

Government Jobs

Free Downloads

Algorithms

Androids
Science

Advertisements

THERE WILL BE HATERS


Hover to Expand

Subscribe Newsletter & Posts


Name

*
Email Address

*
http://www.sanfoundry.com/csharp-mcqs-integer-data-types/

5/7

2/25/2015

C# Questions & Answers Integer Data Types | Sanfoundry

Subscribe

Read Next:
1. C# Questions & Answers Floating and Decimal Data Types
2. Java Questions & Answers Integer and Floating Data Types
3. C# Questions & Answers Do While Loop Statements
4. C Programming Questions and Answers Data Types and Sizes
2
5. C Programming Questions and Answers Data Types and Sizes
1

Manish Bhojasia, a technology veteran with 17+ years @ Cisco &


Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel
Developer and SAN Architect and is passionate about
competency developments in these areas. He lives in Bangalore
and delivers focused training sessions to IT professionals in Linux
Kernel, Linux Debugging, Linux Device Drivers, Linux
Networking, Linux Storage & Cluster Administration, Advanced C
Programming, SAN Storage Technologies, SCSI Internals and
Storage Protocols such as iSCSI & Fiber Channel. Stay
connected with him below.

Manish Bhojasia
Follow
1,289 followers

Sanfoundry
Follow

+1

+ 1,539

http://www.sanfoundry.com/csharp-mcqs-integer-data-types/

6/7

2/25/2015

C# Questions & Answers Integer Data Types | Sanfoundry

Practice Interview Questions & Answers, Quizzes, Objective,


Multiple Choice Aptitude Tests for Freshers and Experienced
People in these topics C, C++, C#, Java, Linux, SAN, Javascript, PHP, Python
Operating Systems, Computer Organization and
Architecture, Database Management Systems, Software
Architecture & Design, Software Engineering, Artificial
Intelligence, LISP Programming, Computer Networks,
Microprocessors
Learn C, C++, Java and C# Programming with coding example
on Simple problems as well as tough Algorithms and Datastructures along with runtime output: - C Programs, DataStructures and Algorithms, C++ Algorithms, Java Algorithms, C#
Programs, Android Programs in Java
C Tutorials and Linux Commands Tutorial - C Tutorials, Linux
Commands
Career Mentoring with our Founder / CTO - Read More

Terms of Use & Privacy Policy


Interns
Jobs
Sitemap

Copyright

Technology Groups

Sanfoundry is No. 1 choice for Deep Hands-ON Trainings in SAN, Linux & C, Kernel & Device Driver Programming. Our Founder has trained
employees of almost all Top Companies in India. Here are few of them: VMware, Citrix, Oracle, Motorola, Ericsson, Aricent, HP, Intuit, Microsoft,
Cisco, SAP Labs, Siemens, Symantec, Redhat, Chelsio, Cavium Networks, ST Microelectronics, Samsung, LG-Soft, Wipro, TCS, HCL, IBM,
Accenture, HSBC, Northwest Bank, Mphasis, Tata Elxsi, Tata Communications, Mindtree, Cognizant, mid size IT companies and many Startups.
Students from top Universities and colleges such as NIT Trichy, BITS Pilani, University of California, Irvine, University of Texas, Austin & PESIT
Bangalore have benefited a lot from these courses as well. The assignments and real time projects for our courses are of extremely high quality
with excellent learning curve.
Register for Expert Level Training Classes by our Founder & CTO. Alternatively, call us for your Corporate Training or College Training
needs.
Responsive Theme powered by
2015 Sanfoundry

WordPress

http://www.sanfoundry.com/csharp-mcqs-integer-data-types/

7/7

Anda mungkin juga menyukai