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

I want to sample Hotel management project in vb.net because still now i am doing that project for small hotel....so please send me my email id is jmuthu_pearls@yahoo.com...

4 Answers   Sapphire Comfort Hotel, TATA,


Describe about visual basic.net?

0 Answers  


What is CLR?

20 Answers   Horizon Computers, Microsoft,


What does VS.NET contains ?

3 Answers   Infosys,


Can we use Vb.Net and C# language simultaneously in one .Net application?

0 Answers   PUCIT,






What is the advantages of VB.NET?

0 Answers   NA,


What is versioning in .NET?

3 Answers   HCL,


What are the different types of Lock available in Visual Basic?

0 Answers   CGI,


What are the difference between dispose(), close(), exit(), end()? When do we use them?

0 Answers  


What are option strict and option explicit?

0 Answers  


What is normal jit?

0 Answers  


Explain about globalization?

0 Answers  


Categories