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.

Answers were Sorted based on User's Feedback



Write a program that accepts an array of numbers and a number, and return a string “Yes” if th..

Answer / 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

Write a program that accepts an array of numbers and a number, and return a string “Yes” if th..

Answer / surabhi

void main()
{
int num,i=0,f=0;
int n[]={20,30,40,50};
printf("\n enter no:");
scanf("%d",&num);
for(;i<4;)
{
if(num==n[i++])
{
printf("\n YES");
f=1;
break;
}
}
if(f==0)
printf("\n NO");
getch();
}

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More VB.NET Interview Questions

What is an application domain? how they get created?

0 Answers  


List the two main parts of .net?

0 Answers  


ColumnMapping belongs to which namespaces?

1 Answers  


What is a static class?

0 Answers  


How can I extract the formated word(bold,italic,underline,font,color etc) from the msword file.?

0 Answers  


Can you please explain the difference between authentication and authorization?

0 Answers  


Explain how to achieve polymorphism in vb.net?

0 Answers  


is it possible to use flexgrid in vb dotnet?

9 Answers   Banking, Microsoft, NetBIOS,


What is enumerator?

0 Answers  


1234 123 12 1 how to design above pic in vb.net?

2 Answers   ABC,


What is the differences between dataset.clone and dataset.copy?

0 Answers  


if user enters 1 or 2 or any other number in digit format in next textbox it should show the answer in word reading like if enters 12 answer should be twelve

4 Answers  


Categories