Techno News, Nexus Lollipop Upgrade, WiFi Adapter, Transfer Photos from LG from Phone, Samsung Galaxy, Stock Firmwares, Huawei Android, Linux

Jumat, 17 Januari 2014

C# Program which calculated factorial to prime function

C# Program which calculated factorial to prime function - very many people who love gadgets, especially gadgets nowadays with all sophisticated spek good, but not all gadgets suitable for your purposes, in blogs Techno News we will review and display speck with price gadgets from various brands and news about gadgets latest, now we will discuss first about C# Program which calculated factorial to prime function please in see until finished because the news that we convey we try to complete for you.

Articles : C# Program which calculated factorial to prime function
full Link : C# Program which calculated factorial to prime function
Article Csharp, Article programming, Article programs,

You can also see our article on:


C# Program which calculated factorial to prime function

C# Program which calculated factorial to prime function

Program Statement:
Write two functions max(int,int) and prime(int). max function will take two arguments and will return the maximum of two numbers in main. Then main function will pass this calculated factorial to prime function which will show that passed value is prime or not.

Solution:
 public class _max
{
public int max(int a, int b)
{
if (a > b)
return a;
else
return b;
}
public void prime(int n)
{
if (n == 1)
Console.WriteLine("\n\t\t{0} is maximum but not prime number!\n\n", n);
if (n >= 2)
{
if (n % 2 != 0)
{
Console.WriteLine("\n\t\t{0} is maximum and Prime number!\n\n", n);
}
else
{ Console.WriteLine("\n\t\t{0} is maximum but not a Prime number!\n\n", n); }
}
}
}




enough already information C# Program which calculated factorial to prime function

hopefully information about C# Program which calculated factorial to prime function that we provide can be useful for you in determining the appropriate gadgets with your needs.

you just read the article with title C# Program which calculated factorial to prime function if you intend to bookmark or share it please use link http://nikephang.blogspot.com/2014/01/c-program-which-calculated-factorial-to.html if you need other information about software or other hardware please visit other page in this blog.

Tag : , , ,
Share on Facebook
Share on Twitter
Share on Google+

Related : C# Program which calculated factorial to prime function

0 komentar:

Posting Komentar