Home

1000+ Visual Basic MCQ for UPSC CDS [Solved]

Thursday 9th of March 2023

Sharing is caring

1. cell alignment property can be used to align the cells with different alignment style
A. True
B. False
C.
D.
Answer : A
2. IsDate() function returns true if its argument is a valid date and time
A. True
B. False
C.
D.
Answer : B
3. To run an application you have to press :
A. F3
B. F6
C. F5
D. F7
Answer : C
4. The maximum length of a variable is _____________ characters.
A. 255
B. 254
C. 256
D. 257
Answer : A
5. In a programme body :
Private sub form_load()
X=inputbox("First No. :")
Y=inputbox("Second No. :")
Z=val(X) +val(Y)
Print Z
End sub
What will be the output ?

A. The summation of two numbers given in two input box
B. It will show the numbers given in the input box side by side
C. It will show nothing
D. None of the above
Answer : C
6. Visual Basic produce:
A. 3 types of executable code.
B. 2 types of executable code.
C. 4 types of executable code
D. none of the above.
Answer : B
7. In visual basic Bool variable stores
A. 2 bytes
B. 1 bytes
C. 4 bytes
D. none of the above.
Answer : D
8. Terminate is a valid event in form operation
A. True
B. False
C.
D.
Answer : A
9. Sorted property of list box control is a design time property and cannot be changed in runtime.
A. True
B. False
C.
D.
Answer : A
10. Min and Max property can be used with Font common dialog box to determine
A. To controlling dialog box size
B. The minimum and maximum size displayed in the size list
C. None of the above
D.
Answer : B
11. Which property of list box control reports the number of selected items.
A. ListIndex
B. Selected
C. Selcount
D. NewIndex
Answer : C
12. It is possible to change the shortcut key assigned to any menu for accessing within the menu editor.
A. True
B. False
C.
D.
Answer : B
13. By default 'Dim myvar' this statement:
A. allocates memory for integer variable
B. allocates memory for variant variable
C. allocates memory for Double variable
D. allocates memory for Boolean variable
Answer : B
14. what will be the output of the code below :
private sub command_click()
dim I as integer
I=0
Do
Print I
Loop until I>10
End sub

A. it will generate compile time error
B. it will generate runtime error
C. it is an endless loop
D. 0 1 2 3 4 5 6 7 8 9 10
Answer : C
15. Data1.Recordset.FindFirst "State=NY"
The above code will find the record in a given database

A. Find the first record in the given database
B. Find the first record in the given database in which the state is NY.
C. The above command will find a record very fast where the state is NY
D. None of the above
Answer : B
16. RichTextBox1.BulletIndent=5 ; what will be the effect of this code if used in any program
A. It will set the bulleted indentation by the specified value
B. It will create a list of bullet of 5 items
C. All of the above
D.
Answer : A
17. Time() function is used to recover date & time.
A. True
B. False
C.
D.
Answer : B
18. You can get the ASCII value of any character or number by using
A. ASC() function
B. ASCII() function
C. There is no function to get the ascii value.
D.
Answer : A
19. There are _________________ no. of built in windows dialog boxes provided by common dialogs control.
A. 6
B. 7
C. 8
D. 9
Answer : A
20. In runtime it is not possible to change the form size.
A. True
B. False
C.
D.
Answer : B
21. Currency variable stores fixed point numbers with :
A. 2 decimal digits.
B. 3 decimal digits.
C. 4 decimal digits.
D. 6 decimal digits.
Answer : C
22. Visual Basic has ____________ number of editions
A. 3
B. 4
C. 5
D. 6
Answer : A
23. A single function of visual basic takes:
A. Fixed number of parameters
B. Unlimited number of parameters
C. All of the above
D. None of the above
Answer : B
24. To draw a form on the screen which event is being called up
A. Draw Event
B. Load Event
C. Paint Event
D. Either i or iii
Answer : C
25. If the Flag constant for the font common dialog box is cdlCFPrinterFonts then it causes the dialog box to show only the fonts supports by the printer specified by the hdc property
A. True
B. False
C.
D.
Answer : A
26. It is possible to build an application without using any form:
A. True
B. False
C.
D.
Answer : A
27. In visual basic you can draw something in
A. Picture box control.
B. Image control.
C. Shape control.
D.
Answer : A
28. Now() function will return the current drive and directory you are working on as return value.
A. True
B. False
C.
D.
Answer : B
29. CommonDialog1.ShowOpen
Filename1=CommonDialog1.Filename
The above code will

A. Set the filename1 by the selected filename from the common dialog contol.
B. First displays the open dialog box and let the user select any file from any
C. location and then set the filename1 by the selected filename.
D. Both are true.
Answer : B
30. Suppose there are two forms; form1 and form2 ; if there are codes like : In form1.active event
Form2.show
And in form2.active event
Form1.show
Then what will be the output ?

A. Two forms will be just showed.
B. Two forms will be showed and the control will passed continuously to each other.
C. Nothing will be displayed
D. None of the above.
Answer : B
31. In visual basic 'Break' statement could be used along with "Select Case"
A. True
B. False
C.
D.
Answer : B
32. In visual basic, number of loop control structure is _____________.
A. 4
B. 5
C. 6
D. 7
Answer : C
33. If the user wants to select the multiple files from file open and filesave dialog boxes then the flag must be set to
A. cdlOFNMultiselsectAllow
B. cdlOFNAllowMultiselect
C. It is not possible to select more than one file at a time
D. None
Answer : B
34. What will be the output when the statements below will execute :
Dim a as integer
a=0
while(a<5)
print a
a=a+1
end

A. It will generate the output like 0 1 2 3 4
B. It will generate a runtime error
C. It will generate a compiler error
D. It will display nothing
Answer : C
35. DocumentForm() it is
A. A function of MDI forms
B. An array of forms using as child into MDIform
C. None of the above
D.
Answer : B
36. Activate event is called before load event
A. True
B. False
C.
D.
Answer : B
37. Time variable is used to store date and time in visual basic
A. True
B. False
C.
D.
Answer : B
38. It is possible to change the password character property of text box control at run time.
A. True
B. False
C.
D.
Answer : B
39. It is possible to pass different number parameters to a function when call the function on different time.
A. To do this one can use in the parameter list of that function
B. paramarray keyword with the array declaration
C. argument should be passed as array
D. none of the above
Answer : B
40. In visual basic the default unit is :
A. centimeter.
B. Inch.
C. Dpi.
D. Twips .
Answer : D
41. You can get a dropdown list and as well as can add some text directly to ____________ Control.
A. listbox
B. command
C. Combo Box.
D. none of this
Answer : C
42. The size of 'Boolean' data type is :
A. 1 Byte.
B. 2 Bytes.
C. 4 Bytes.
D. 8 Bytes.
Answer : B
43. Flag property is used to adjust the function of each common dialog box
A. True
B. False
C.
D.
Answer : A
44. Instr$(text1.text,"visual") will returns :
A. No. of times the string "visual" is present in the string in text1.text.
B. It puts the control where it finds the text "visual" in the string given in text1.text.
C. First occurrence of the text "visual" within the string given in text1.text
D. None of the above.
Answer : C
45. To enable apply button in dialog box ; flag value should be set to
A. cdlCFApply
B. cdlcfTTOnly
C. cdcclHelpButton
D. None of the above
Answer : A
46. Function Add(Num1 as integer, Num2 as integer) as integer
Add=Num1+Num2
Num1=0
Num2=0
End function
This body is an example of calling up a function by:

A. By optional argument.
B. By value.
C. By reference.
D.
Answer : C
47. It is possible to load a MDI form without any childform.
A. True
B. False
C.
D.
Answer : A
48. To break a loop abnormally when satisfying a condition, we can use
A. Break statement
B. Exit statement
C. Both i & ii could be used.
D. None of the above.
Answer : B
49. Constants are processed faster than variables :
A. True
B. False
C.
D.
Answer : A
50. MDI form1.Arrange vbTileHorizontal; this code in a MDI form will
A. If there are more than one MDI form then arrange them all in horizontal manner
B. Tiles all child form in horizontal manner
C. Tiles the MDI form horizontally
D. None of the above.
Answer : B

Sharing is caring