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
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 |
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 |
What is the Difference between Web User Control and Web Custom Control?
Regarding Types of compatability in VB and their usage ?
Can you please explain the difference between int and int32?
What’s the difference between private and shared assembly?
How does you call and execute a SP in .NET?
How to store decimal data in .net?
Explain about globalization?
What is "Polymorphism" and what are Polymorphism in VB.Net?
Explain about the feature anonymous type?
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
How to view an assembly?
How do you use two datareaders at the same time in a vb.net windows application ?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)