Write a program that accepts an array of numbers and a
number, and return a string “Yes” if
the number is found in the array, “No” if the number is not
found in the array.

Answer Posted / lince

Dim num() As Integer = {5, 3, 6, 7, 1}
Public Function Find(ByVal sNum As Integer) As String
Dim i As Integer = 0
For i = 0 To num.Count - 1
If (sNum = num(i)) Then
Return "Yes"
End If
Next
Return "No"
End Function

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain enumerator?

701


What is datatype conversion?

748


i am attending to US consulate i kept my projects on vb.net ,please help me what questions will be ask on vb.net in us consulate

2126


List the two main parts of .net?

782


What is the difference between custom control and user control?

760


What’s the difference between private and shared assembly?

888


What is the difference between convert.tostring and .tostring() method?

777


i have two class that contain's two methods as same name in derived class i have to call these two methods what will happen at run time ?

2450


Why do we use byref keyword in vb.net?

817


Can you please explain the difference between namespace and assembly?

751


Explain option explicit?

771


What is the feature which is common to all .net languages?

706


List the types of generations in garbage collector?

690


what is diffrence constructor and destructor in vb

737


What is globalization?

741