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 private assembly?

0 Answers  


is ADO.NET important to connect sql server? is any other way to connect sql server?

1 Answers  


Explain manifest?

0 Answers  


Can you please explain the difference between dataset and datareader?

0 Answers  


What is the strong name in .net assembly?

0 Answers  






Write a program for calculator in VB.NET

6 Answers   CMC, College School Exams Tests, IBM, NIIT, Practical Viva Questions, Subex,


Difference between a sub and a function?

2 Answers  


sir i want to ask you that how can i fetch or get sql data into texboxes.where i want to show record in specific texboxes related to student information.when i click on button all data show on texboxes when i put id or name plz inform me on my id

1 Answers  


visual basic 6.0 hava print statement for printing on form.what is the alternative for this in vb.net?

5 Answers  


Explain the difference between dispose and finalize()?

0 Answers  


What is writeline in vb.net?

0 Answers  


Define cls?

0 Answers  


Categories