Posts Tagged ‘VB.NET to C#’

.NET platform is an umbrella of languages. Many times developers who work in .NET  will have or find code in one language  when they need it in different language.

Many sites provide language conversion options which is very handy for developers and following link is one of such link …

http://www.developerfusion.com/tools

public void PrimeNumberCheck(object sender, ServerValidateEventArgs args)
{
int iPrime = Convert.ToInt32(args.Value);
int iLoop = 0;
int iSqrt = Convert.ToInt32(Math.Sqrt(iPrime));

for (iLoop = 2; iLoop <= iSqrt; iLoop++) {
if (iPrime % iLoop == 0) {
args.IsValid = false;
return;
}
}

args.IsValid = true;
}