Objective Questions of C# with Answer set-2

0
C# MCQs
Objective Questions in C#

1. In C# variables are categorized into ..........

i) Value types          ii) Reference types              iii) initial types             iv) pointer types

A) i, ii and iii only

B) ii, iii and iv only

C) i, ii and iv only

D) All i, ii, iii and iv


2. Value type variables can be assigned a value directly which are derived from the class

A) System.value

B) System.ValueType

C) General.ValueType

D) Variable.ValueType


3. The various data types used in C# are

i) Integral Type           ii) Floating point types

iii) Boolean types       iv) Nullable types

A) i, ii and iii only

B) ii, iii and iv only

C) i, iii and iv only

D) All i, ii, iii and iv


4. The built-in operators that are provided by C# programming language are...

i) Arithmetic operators          ii) Logical operators

iii) Bitwise operators             iv) Assignment operators

A) i, ii and iii only

B) ii, iii and iv only

C) i, iii and iv only

D) All i, ii, iii and iv


5. Match the different Bitwise operators supported by C# with their descriptions.

i) &                   a) Binary Left Shift Operator

ii) ^                   b) Binary Right Shift Operator

iii) <<               c) Binary XOR operator

iv) >>               d) Binary AND operator

A) i-d, ii-c, iii-a, iv-b

B) i-b, ii-c, iii-a, iv-d

C) i-c, ii-a, iii-b, iv-d

D) i-a, ii-c, iii-d, iv-b



6. What will be the value of the following expression if x=10?

A) 25

B) -5

C) 10

D) 15


7. While passing parameter to a method ................ copies the actual value of an argument into the formal parameter of the function.

A) Output Parameter

B) Value Parameter

C) Reference Parameter

D) Initial Parameter


8. In C# methods can be defined by using which of the following syntex?

A) <Method Name> (parameter list) { Method body }

B) <Method Name> <Return Type> <Access Specifier> (parameter list) { Method body }

C) <Return Type> <Method Name> <Access Specifier> (parameter list) { Method body }

D) None of the above


9. Which of the following are the methods to assign values to an array?

i) double [ ] score = {234.0, 214.5, 572.0};

ii) int [ ] marks = new int [3] {33, 45, 67};

iii) int [ ] marks = new int [ ] {33, 45, 67};

A) i and ii only

B) ii and iii only

C) i and iii only

D) All i, ii, iii


10. State whether the following statements are True or False.

i) Unlike classes, structures cannot inherit other structures or classes.

ii) A structure can implement one or more interfaces.

iii) Structure members can be specified as abstract, virtual or protected.

A) i- True, ii- False, iii-True

B) i- False, ii- True, iii-True

C) i-True, ii-True, iii-False

D) i- False, ii- False, iii-True


Answers:

1.   C) i, ii and iv only
2.   B) System.ValueType
3.   D) All i, ii, iii and iv
4.   D) All i, ii, iii and iv
5.   A) i-d, ii-c, iii-a, iv-b
6.   A) 25
7.   B) Value Parameter
8.   A)<Access Specifier><Return Type> <Method Name> (parameter list) {Method body}
9.   D) All i, ii, iii
10. C) i-True, ii-True, iii-False


You Might also view the following Related Posts

Solved Objective Questions of C# set-1

0

1. Which of the following is not the component of .Net framework?

A) Common Language Run time(CLR)

B) .Net Framework Library.

C) Component Network

D) Windows Workflow Foundation (WF)


2. Following is/are the Integrated Development Environment (IDE) for C#.

A) Visual Studio 2010 (VS)

B) Visual Web Developer

C) Both A and B
Visual overview of the Common CLR Language Inf...
Visual overview of the Common CLR Language Infrastructure, and how the components relate to each other. Converted to SVG from PNG version, originally by Foofy from English Wikipedia. (Photo credit: Wikipedia)

D) Only A


3. A C# program may consist of the following parts.

i) Namespace declaration

ii) Class methods

iii) A main method

iv) Statement & Expressions

A) i, ii and iii only

B) ii, iii and iv only

C) i, iii and iv only

D) All i, ii, iii and iv


4. State True or False for naming class in C#.

i) The class name can be a C# keyword.

ii) A name must begin with a letter, can be followed by letters, digits and underscore.

A) i- True, ii- False

B) i- False, ii- True

C) i-True, ii-True

D) i- False, ii- False


5. ...................... is a name which can be used to identify a class, variable, function etc.

A) Keyword

B) Reference

C) Identifier

D) Object


6. .................... conversions are performed by C# compiler itself and ..................... conversions are performed by users by using predefined functions.

A) Implicit type, Explicit type

B) Explicit type, Implicit type

C) External type, Internal type

D) Internal type, External type


7. A variable can be declared by using which of the following syntax?

A) <variable_list> <data_type>;

B) <variable_list>, <data_type>

C) <data_type> <variable_list>

D) <data_type> <variable_list>;


8. Match the following.

i) *                  a) returns the address of an variable

ii) ? :                b) point to variable

iii) &                c) conditional expression

A) i-a, ii-b, iii-c

B) i-b, ii-c, iii-a

C) i-c, ii-a, iii-b

D) i-a, ii-c, iii-b


9. C# supports the following types of access specifiers.

i) public ii) friend iii) private iv) protected v) internal

A) i, ii, iii and iv only

B) i, iii, iv and v only

C) i, ii, iv and v only

D) All i, ii, iii, iv and v


10. ........................ access specifier allows a class to expose it's member variables and member functions to other functions and objects in the current application.

A) Internal

B) Protected

C) Private

D) Public


Answers:

1.  C) Component Network
2.  C) Both A and B
3.  D) All i, ii, iii  and iv
4.  B) i- False, ii- True
5.  C) Identifier
6.  A) Implicit type, Explicit type
7.  D) <data_type> <variable_list>;
8.  B) i-b, ii-c, iii-a
9.   B) i, iii, iv and v only
10. A) Internal


You Might also view the following Related Posts

Solved Objective Questions of CSS set-4

0

1. In CSS filters, ........................... will be used to create a shadow of object at the specified horizontal and vertical offset and color.

A) Drop shadow effect

B) Chroma filter

C) Shadow object effect

D) Shadow filter


2. ............................. will be used to create attenuated shadow in the direction and color specified.
English: graphic of the main CSS table spaces
English: graphic of the main CSS table spaces (Photo credit: Wikipedia)

A) Drop shadow effect

B) Chroma filter

C) Shadow object effect

D) Shadow filter


3. State whether the statements are true or false.

i) Glow effect will be used to create a glow around the object.

ii) The two parameters used in glow effect are color and intensity.

iii) Invert effect will be used to create a negative image

A) i-true, ii-true, iii-true

B) i- true, ii-false, iii-true

C) i-false, ii-true, iii-true

D) i-false, ii-false, iii-true


4. Which of the following are the parameters used in wave effect of CSS filter property?

i) add        ii) freq          iii) light          iv) phase         v) intensity


A) i, ii, iii and iv only

B) i, ii, iii and v only

C) i, ii, iv and v only

D) All i, ii, iii, iv and v


5. Match the different CSS media types with their descriptions.

i) all a) Intended for speech synthesizers.

ii) aural b) Intended primary for color computer screen.

iii) screen c) Intended for paged braille printers.

iv) embossed d) Suitable for all devices

A) i-a, ii-b, iii-c, iv-d

B) i-c, ii-d, iii-a, iv-b

C) i-d, ii-a, iii-b, iv-c

D) i-b, ii-c, iii-d, iv-a


6. The ................... property allows you to specify the content for a <caption> element should be placed in relationship to the table.

A) Caption

B) Caption-side

C) Caption-position

D) Caption-align



7. The ........................... property indicates whether a cell without any content should have a border displayed.

A) empty-row

B) empty-column

C) empty-cell

D) empty



8. The ........................ property for HTML tables in CSS specifies whether the browser should control the appearance of adjacent borders that touch each other.

A) border-spacing

B) border-collapse

C) caption-side

D) table-layout



9. The ................. property indicates whether the marker should appear inside or outside of the box containing the bullet points.

A) list-style-align

B) list-style-type

C) list-style-position

D) list-style-appearance



10 . The overflow property of CSS can take one of the following values.

i) visible                  ii) invisible              iii) hidden             iv) scroll           v) auto

A) i, ii, iii and iv only

B) i, iii, iv and v only

C) i, ii, iv and v only

D) All i, ii, iii, iv and v


Answers:

1.  A) Drop shadow effect
2.  D) Shadow filter
3.  B) i- true, ii-false, iii-true
4.  A) i, ii, iii and iv only
5.  C) i-d, ii-a, iii-b, iv-c
6.  B) Caption-side
7.  C) empty-cell
8.  B) border-collapse
9   C) list-style-position
10  B) i, iii, iv and v only


You Might also view the following Related Posts

Objective Questions of CSS with Answer set-3

0

1. The following syntax to set margin around a paragraph will make- p{margin:10px 2%}

A) Top and bottom margin will be 10px and left and right margin will be 2% of the total width.

B) Left and right margin will be 10px and top and bottom margin will be 2% of the total height

C) Top margin will be 10px and other margins will be 2% of the total width

D) Left margin will be 10px and other margins will be 2% of the total width


2. The ...................... property allows you to control the shape or style of bullet point in the case of unordered lists, and the style of numbering characters in ordered list.

A) list-style-type

B) list-style-layout

C) list-type-style

D) list-type


Box model in CSS
Box model in CSS (Photo credit: Wikipedia)


3. The ......................... property allows to specify the distance between the list and the text relating to the list.

A) list-spacing

B) marker-spacing

C) marker-offset

D) list-offset


4. The ...................... property allows to specify how much space appear between the content of an element and it's border.

A) Spacing

B) Marking

C) Padding

D) Content-border


5. State True or False for CSS outlines properties.

i) An outline does take up space

ii) Outline do not have to be rectangular.

iii) Outline is always the same on all sides.

A) i-True, ii-True, iii-False

B) i-False, ii-False, iii-True

C) i-True, ii-False, iii-True

D) i-False, ii-True, iii-True


6. The overflow property in CSS can take one of the following values.

i) visible ii) hidden iii) scroll iv) non-scroll v) auto

A) i, ii, iii and iv only

B) i, ii, iii and v only

C) i, ii, iv and v only

D) All i, ii, iii, iv and v



7. Which of the following is/are the valid syntax for CSS pseudo classes.

A) selector: pseudo-class{property: value}

B) selector.class: pseudo-class{property:value}

C) Both A and B

D) None of the above


8. The valid examples of ID selectors is/are

A) #black{color: #000000;}

B) h1 #black{color: #000000;}

C) #black h2{color: #000000;}

D) All of the above


9. Which of the following is/are the possible values of CSS pseudo element property?

i) : first line ii) : last-line iii) : before iv) : after v) : between

A) i, iii and iv only

B) i, ii, and v only

C) i, ii, iv and v only

D) All i, ii, iii, iv and v


10. The ............... rule is used to make sure that the property always be applied whether another property appears in CSS.

A) @important

B) #important

C) !important

D) !first

Answers:

1.  A) Top and bottom margin will be 10px and left and right margin will be 2% of the total width.
2.  A) list-style-type
3.  C) marker-offset
4.  C) Padding
5.  D) i-False, ii-True, iii-True
6.  B) i, ii, iii and v only
7.  C) Both A and B
8.  D) All of the above
9   A) i, iii and iv only
10 C) !important


You Might also view the following Related Posts

MCQ of CSS With Answer set-2

0
MCQ of CSS With Answer
English: css - absolute position (Photo credit: Wikipedia)

1. Which of the following are the background properties in CSS?

i) background-color ii) background-image iii) background-repeat

iv) background-position v) background

A) i, ii, iii and iv only

B) i, ii, iii and v only

C) i, ii, iv and v only

D) All i, ii, iii, iv and v


2. State whether the statement is/are True.

i) font-family property is used to change the face of a font.

ii) font-variant property is used to create small-caps effects.

A) i-True, ii-False

B) i-False, ii-True

C) i-True, ii-True

D) i-False, ii-False


3. The CSS links properties are

A) :link, :visited, :hover, :active

B) :link, :visit, :hover, :active

C) :link, :visited, :over, :active

D) :link, :visited, :hover, :active, :inactive


4. Internet Explorer uses ....................... property to create transparent images.

A) -moz-opacity:x

B) filter: alpha(opacity=x)

C) Both of the above

D) None of the above


5. The different ways to associate styles with a HTML document is/are

A) Embedded CSS with <style> element

B) Inline CSS with style attribute.

C) External CSS with <link> element.

D) All of the above


6. Which of the following is correct CSS syntex for using font property?

A) <p style="font: italic, bold, 15px;"> ................ </p>

B) <p style="font-style: italic font-weight: bold font-size: 15px;"> ................... </p>

C) <p style="font: italic bold 15px;"> ....................... </p>

D) None of the above


7. State True of False for the CSS table properties.

i) The border-spacing specifies the width that should appear between table rows.

ii) The empty-cells specifies whether the border should be shown if a cell is empty.

A) i-True, ii-False

B) i-False, ii-True

C) i-True, ii-True

D) i-False, ii-False


8. In CSS tables, the possible values for the caption-side property can have the following values.

A) top, bottom, left or right

B) top, bottom, center, left or right

C) top or bottom

D) left or right


9. The ................... property indicates whether a cell without any content should have a border displayed.

A) blank-cells

B) empty-cells

C) nocontent-cells

D) noborder-cells


10. The ..................... specifies whether a border should be solid, dashed line, doted line, double line, groove etc.

A) border-layout

B) border-decoration

C) border-style

D) border-weight

Answers:

1.  D) All i, ii, iii, iv and v
2.  C) i-True, ii-True
3.  A) :link, :visited, :hover, :active
4.  B) filter: alpha(opacity=x)
5.  D) All of  the above
6.  C) <p style="font: italic bold 15px;"> ....................... </p>
7.  B) i-False, ii-True
8.  A) top, bottom, left or right
9   B) empty-cells
10 C) border-style


You Might also view the following Related Posts

Solved MCQ of CSS set-1

0
A perfect desktop image for CSS developers
Cascading Style Sheet (CSS) (Photo credit: Wikipedia)

1. Which of the following are the advantages of CSS?

i) CSS saves time ii) Page load faster

iii) Easy maintenance iv) Multiple compatibility


A) i, ii and iii only

B) ii, iii and iv only

C) i, ii and iv only

D) All i, ii, iii and iv


2. A CSS style rule is made up of three parts which are ..

i) Selector ii) Property

iii) Value iv) Attribute

A) i, ii and iii only

B) ii, iii and iv only

C) i, ii and iv only

D) All i, ii, iii and iv


3. Which is not the selector type of CSS?

A) Type selector

B) Universal selector

C) Local selector

D) Descendant selector


4. The correct example of class selector is .

A) h2.type1 {color: #000000;}

B) h2 type1 {color: #000000;}

C) h2 #type1 {color: #000000;}

D) #h2 type1 {color: #000000;}


5. CSS comments are inserted inside .

A) //...................//

B) <!..................>

C) /*..................*/

D) All of the above


6. We can handle old browsers by placing CSS codes inside.

A) //...................//

B) <!..................>

C) /*..................*/

D) None of the above


7. State whether True or False.

i) Any inline style sheet takes highest priority.

ii) Any rule defined in <style> ...........................</style> tag will override rules defined in any external style sheet file.

A) i-True, ii-False

B) i-False, ii-True

C) i-True, ii-True

D) i-False, ii-False


8. ...................... is used to import an external style sheet in a manner similar to the <link> element.

A) @insert

B) @import

C) #import

D) #insert


9. Which of the following is / are the measurement units in CSS?

i) % ii) cm iii) em iv) pc v) px

A) i, ii, iii and iv only

B) i, ii, iii and v only

C) i, ii, iv and v only

D) All i, ii, iii, iv and v


10. The possible formats of CSS colors are.

i) Hex code - #RRGGBB

ii) Short Hex Code - #RGB

iii) RGB% - rgb(rrr%, ggg%, bbb%)

iv) Keyword - teal, blue, black

A) i, ii and iv only

B) ii, iii and iv only

C) i, iii and iv only

D) All i, ii, iii and iv

Answers:

1.  D) All i, ii, iii and iv
2.  A) i, ii and iii only
3.  C) Local selector
4.  A) h2.type1 {color: #000000;}
5.  C) /*..................*/
6.  B) <!..................>
7.  C) i-True, ii-True
8.  B) @import
9   D) All i, ii, iii, iv and v
10 D) All i, ii, iii and iv


You Might also view the following Related Posts

Solved MCQ of Microsoft Word set-1

0

1. In which shortcut key use to center the selecting text.

A) Ctrl+F

B) Ctrl+E

C) Ctrl+M

D) None of the above


2. You can Hyperlink the file

A) Pressing the Ctrl+Enter

B) Pressing Ctrl+Shift+Enter

C) Break command from view menu

D) Both A and C


3. Which of the following is not a part of standard office suite?

A) Word Processor

B) Database

C) Image Editor

D) File Manager


4. Which bar is usually located below that title bar that provides categorized options?

A) Menu bar

B) Toolbars

C) Status Bar

D) All of the above




5. Which of the following are valid Minimum and Maximum zoom size in MS Word?

A) 20, 200

B) 10, 300

C) 10, 500

D) 15, 400


6. Which of the following are the Minimum and Maximum font size of MS Word?

A) 1, 72

B) 2, 128

C) 4, 1800

D) 1, 1638


7. We can insert Maximum number of Columns are

A) 35

B) 45

C) 25

D) 15


8. To move the cursor page to page of documents.

A) Ctrl+ Page Down

B) Ctrl+Page UP

C) Both of the above

D) None of the above


9. The four types of mail merge main documents are

A) Form letters, directories, catalogs and envelopes

B) Form letters, Envelops and Mailing labels, directories and lists

C) Basic letters, envelopes, labels and list

D) Form letters, envelopes, mailing labels and catalog


10. You can break the active column using

A) Break From Insert Command

B) Ctrl+Shift+Enter

C) Ctrl+Enter

D) Both A and B

Answers:

1.  B) Ctrl+E
2.  D) Both A and C
3.  D) File Manager
4.  C) Status Bar
5.  C) 10, 500
6.  D) 1, 1638
7.  B) 45
8.  C) Both of the above
9   D) Form letters, envelopes, mailing labels and catalog
يتم التشغيل بواسطة Blogger.