Explore topic-wise MCQs in Testing Subject.

This section includes 657 Mcqs, each offering curated multiple-choice questions to sharpen your Testing Subject knowledge and support exam preparation. Choose a topic below to get started.

1.

What does the following code display while execution? class Program { static void Main(string[] args) { int ch; HttpWebRequest req = (HttpWebRequest) WebRequest.Create("http://www.McGraw-Hill.com"); HttpWebResponse resp = (HttpWebResponse) req.GetResponse(); Stream istrm = resp.GetResponseStream(); for (int i = 1 ; ;i++) { ch = istrm.ReadByte(); if (ch == -1) break; Console.Write((char)ch); if ((i % 400) == 0) { Console.Write(" nPress Enter."); Console.ReadLine(); } } resp.Close(); } }

A. Html
B. Text
C. Html/text
D. Text/html
Answer» E.
2.

Correct output for the given C#.NET code is ? static void Main(string[] args) { string s1 = "Delhi"; string s2; s2 = s1.Insert (6, "Jaipur"); Console.WriteLine(s2); }

A. DelhJaipuri
B. Delhi Jaipur
C. Delhi
D. DelhiJaipur
Answer» E.
3.

Select the output for given string ? Enter a String:BOMBAY. static void Main(string[] args) { string Str, Revstr = " "; int Length; Console.Write("Enter A String : "); Str = Console.ReadLine(); Length = Str.Length - 1; while (Length >= 0) { Revstr = Revstr + Str[Length]; Length --; } Console.WriteLine("Reverse String Is {0}", Revstr); Console.ReadLine(); }

A. BOMBA
B. YABMOB
C. BOMAYB
D. YABMO
Answer» C. BOMAYB
4.

Select the appropriate set of code for conversion of string to hexa form. static void Main(string[] args) { string teststring = "MIKA@?&"; string hex = ConvertstringToHex(teststring, system.Text.Encoding.Unicode); Console.WriteLine(hex); } a) static string ConvertstringToHex(string input, system.Text.Encoding encoding) { string Bytes = encoding.GetBytes(input); string Builder sbBytes = new Builder sbBytes(); for each (byte 'b' in StringBytes) { sBytes.AppendFormat("{0:x2}", b); } return sbBytes.Tostring(); } b) static string ConvertstringToHex(string input, system.Text.Encoding encoding) { char[]string Bytes = encoding.GetBytes(input); string Builder sbBytes = new Builder sbBytes(StringBytes.Length*2); for each (byte 'b' in StringBytes) { sBytes.AppendFormat("{0:X2}", b); } return sbBytes.Tostring(); } c) public static string ConvertStringToHex(String input, System.Text.Encoding encoding) { { Byte[] stringBytes = encoding.GetBytes(input); StringBuilder sbBytes = new StringBuilder(stringBytes.Length * 2); foreach (byte b in stringBytes) { sbBytes.AppendFormat("{0:X2}", b); } Console.WriteLine(sbBytes.ToString());//sbBytes.ToString()); return sbBytes.ToString(); } }

A. A
B. B
C. C
D. None of the mentioned
Answer» D. None of the mentioned
5.

Which of the following code is used for conversion of hex to string form ? static void Main(string[] args) { string testString = "MIKA@?&^"; string normal = ConvertHexToString (hex, System.Text.Encoding.Unicode); Console.WriteLine(normal); Console.ReadLine(); } a) public static string ConvertHexToString(String hexInput, System.Text.Encoding encoding) { char[] numberChars = hexInput.Length; byte[] bytes = new byte[numberChars / 2]; for (int i = 0; i < numberChars; i += 2) { bytes[i / 2] = Convert.ToByte(hexInput.Substring(i, 0), 16); } return encoding.GetString(bytes); } b) public static string ConvertHexToString(String hexInput, System.Text.Encoding encoding) { int numberChars = hexInput.Length; byte[] bytes = new byte[numberChars / 2]; for (int i = 0; i < numberChars; i += 2) { bytes[i / 2] = Convert.ToByte(hexInput.Substring(i, 2), 16); } return encoding.GetString(bytes); } c) public static string ConvertHexToString(String hexInput, System.Text.Encoding encoding) { string numberChars = hexInput.Length; byte[] bytes = new byte[numberChars]; for (int i = 0; i < numberChars; i += 2) { bytes[i / 2] = Convert.ToByte(hexInput.Substring(i, 2), 16); } return encoding.GetString(bytes); }

A. A
B. B
C. C
D. None of the mentioned
Answer» C. C
6.

Correct output for the C#.NET code given below is : string s1 = " I AM BEST "; string s2; s2 = s1.substring (5, 4); Console.WriteLine (s2);

A. AM BEST
B. I AM BES
C. BEST
D. I AM
Answer» D. I AM
7.

What will be the output of the C#.NET code snippet given below? namespace McqsMentorConsoleApplication { class SampleProgram { static void Main(string[ ] args) { int i = 5; int j; fun1(ref i); fun2(out j); Console.WriteLine(i + ", " + j); } static void funl(ref int x) { x = x * x; } static void fun2(out int x) { x = 6; x = x * x; } } }

A. 5, 6
B. 5, 36
C. 25, 36
D. 25, 0
Answer» D. 25, 0
8.

Which element is used for creating links?

A.
B.
C.
D.
Answer» B.
9.

Relative URLs are used to ____________

A. Link other pages within the same site
B. Link the same page with other sites
C. Link other pages with other sites
D. Does not link
Answer» B. Link the same page with other sites
10.

What is the color of an unvisited link?

A. Red
B. Blue
C. Purple
D. Green
Answer» C. Purple
11.

Which one of the following is not the value of the target attribute?

A. _blank
B. _top
C. _self
D. _empty
Answer» E.
12.

File paths are not used for linking in _________

A. JavaScripts
B. PHP
C. Style Sheets
D. Images
Answer» C. Style Sheets
13.

How can we insert Javascript in HTML?

A. Using sockets
B. Using marquee tag
C. Using script tag
D. Using style tag
Answer» D. Using style tag
14.

Which one of the following will set viewport to contain given bounds?

A. FitBounds()
B. GetBounds()
C. GetHeading()
D. PanTo()
Answer» B. GetBounds()
15.

Which of the following markup is correct?i. is in error as tags crossii. is not since tags nest

A. I
B. Ii
C. I and ii
D. None of the mentioned
Answer» C. I and ii
16.

Choose the incorrect escape character entity

A. >
B. >
C. <
D. None of the mentioned
Answer» E.
17.

specifies date and time with

A. Local time
B. International time
C. No time zone
D. Local time zone
Answer» D. Local time zone
18.

defines a

A. Link to reset all the form values
B. Reset button
C. Reset field
D. Reset radio button
Answer» C. Reset field
19.

Server-Sent Events allows a web page to get updates from

A. Windows
B. Local Storage
C. Server
D. None
Answer» D. None
20.

Server-Sent Events usually denoted as?

A. SE
B. SSE
C. Server Event
D. SS-Events
Answer» C. Server Event
21.

In HTML form is used for

A. One line text
B. Block of text
C. One paragraph
D. None
Answer» B. Block of text
22.

For style foundation Bootstrap uses____________

A. LESS
B. Sass
C. Resizer
D. Stylus
Answer» B. Sass
23.

HTML local storage object that stores data for one session is?

A. Window.sessionStorage
B. Window.localStorage
C. Window.blockStorage
D. Window.localStorage
Answer» B. Window.localStorage
24.

Scrolling piece of text displayed either horizontally or vertically is created by

A. tag
B.
C. tag
D. None of them
Answer» D. None of them
25.

My Web Page displays?

A. Centered align paragraph
B. Centered align Heading
C. Left aligned paragraph
D. Left aligned Heading
Answer» C. Left aligned paragraph
26.

Consider the markup. Which HTML5 element can replace the ? ?

A.
B.
C.
D. Both a and b
Answer» E.
27.

Which of the following selects all elements and all elements? A. Element,element B. Element+element C. Element,element D. Element element Answer: C . Element,element 0Shares0 0

A. Element,element
B. Element+element
C. Element,element
D. Element element
Answer» D. Element element
28.

Which of the following selects every element whose href attribute value contains the given substring?

A. Attribute$=value
B. Attribute*=value
C. Attribute^=value
D. Attribute|=value
Answer» C. Attribute^=value
29.

Which of the following selects every element that has no children?

A. :empty
B. :enabled
C. :checked
D. :disabled
Answer» B. :enabled
30.

Which of the following will select every element that is the only child of its parent?

A. :only-child
B. :only-of-type
C. :optional
D. :out-of-range
Answer» B. :only-of-type
31.

Which CSS property is equivalent for the attribute ?

A. Font-family
B. Font-style
C. Color
D. All of the mentioned
Answer» C. Color
32.

The President of India is elected by the

A. Members of the Lok Sabha
B. Members of Both houses of the parliament
C. Members of the State Legislature
D. Electoral college consisting of the elected members of Both Houses of the parliament and State Assemblies
Answer» E.
33.

Which one of the following computers is the fastest, biggest and expensive computer?

A. Personal Computer
B. Laptop
C. Netbook
D. Super computer
Answer» E.
34.

The salary of the President is

A. Fixed in constitution
B. Fixed by a law made by the Parliament
C. It is mentioned in the Second Schedule of the Constitution
D. All of the above
Answer» D. All of the above
35.

Who was the only Secretary General of the UNO to have died while in office ?

A. a
B. b
C. c
D. d
Answer» B. b
36.

All India Harijan Sangha established in?

A. 1930
B. 1931
C. 1932
D. 1933
Answer» D. 1933
37.

The computer s processor consists of following parts

A. CPU and Main memory
B. Hard disc and Floppy disc
C. Main Memory and Storage
D. Operating system and Applications
Answer» D. Operating system and Applications
38.

Mangal Pandey was a sepoy at?

A. Royal Gorkha Rifle
B. 34th Bengal Native Infantary
C. Sikh Regiment
D. None of above
Answer» C. Sikh Regiment
39.

If the RBI adopts an expansionist open market operations policy, this means that it will

A. buy securities from non-government holders
B. sell securities in the open market
C. offer commercial banks more credit in the open market
D. openly announce to the market that it intends to expand credit
Answer» D. openly announce to the market that it intends to expand credit
40.

First battle of Panipat was fought between?

A. Babur and Lodi
B. Akbar and Hemu
C. Mughal and British
D. Akbar and Lodi
Answer» B. Akbar and Hemu
41.

The super computer PARAM was developed by

A. TATA
B. IIT-Kharagpur
C. IIT-Kanpur
D. C-DAC
Answer» E.
42.

Subsidies mean that is

A. payment by government for purchase of goods and services
B. payment made by business enterprises to factors of production
C. payment made by companies to shareholders
D. payment made by the government to business enterprises, without buying any goods and services
Answer» E.
43.

The Constitution of India came into effect from?

A. 15 January, 1950
B. 26 January, 1950
C. 15 August, 1950
D. 15 January, 1950
Answer» C. 15 August, 1950
44.

Second battle of Panipat was fought between?

A. Babur and Lodi
B. Akbar and Hemu
C. Mughal and British
D. Akbar and Lodi
Answer» C. Mughal and British
45.

Short-term finance is usually for a period ranging up to

A. 5 months
B. 10 months
C. 12 months
D. 8 months
Answer» D. 8 months
46.

Who was the founder of Madras?

A. Francis Day
B. Lord Dalhousie
C. Sir John Child
D. Robert Clive
Answer» B. Lord Dalhousie
47.

Constitution of India was adopt by constituent assembly on?

A. 25 October, 1948
B. 25 October, 1949
C. 26 November, 1948
D. 26 November, 1949
Answer» E.
48.

Vermicompost is a/an

A. Inorganic fertilizer
B. toxic substance
C. organic biofertilzer
D. synthesis fertilizer
Answer» D. synthesis fertilizer