60 721
Assignments Done
97,9%
Successfully Done
In April 2018

Answer to Question #13768 in Visual Basic for with

Question #13768
Write a predicate to find the two prime numbers that sum up to a given even integer.
Example:
Input: 28
Output: 5
Expert's answer
Private Delegate Sub numManip()

Sub Main()
Dim evennumber As numManip
Dim allNumbers As [Delegate]
evennumber = New numManip(AddressOf Even)
allNumbers = [Delegate].Combine(evennumber)
allNumbers.DynamicInvoke()
End Sub

Sub Even()
Console.Clear()
Dim counter As Integer = 2
Console.WriteLine("Even Numbers")
Console.WriteLine("Please Enter the Number you Wish to End at: ")
Dim number As Integer = Console.ReadLine()
Console.Clear()
Console.WriteLine("All Even Numbers From 6 to " & number)
Do Until counter > number
Console.WriteLine(counter)
counter += 2
Loop
Console.WriteLine("Press Enter to Continue...")
Console.ReadLine()
End Sub

Public Enum Numbers
Unset
Prime
Composite
End Enum

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions