Fun Gadget World, Samsung Tool PRO, Android Multi Tools, Android Jelly Bean, stock firmware, AT&T Connect, Ulefone Tiger, techno n8 and Octopus Box LG Setup

C# Program which calculated factorial to prime function

C# Program which calculated factorial to prime function - a lot of websites that discuss information about gadgets, including this blog Fun Gadget World we discuss all the information from various brands of gadgets, from the old to the latest, which is very dear if you miss, now we discuss first about C# Program which calculated factorial to prime function we have collect lots of data to create this article so that you get complete information, so please read it:

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); }
}
}
}




information C# Program which calculated factorial to prime function has been completed in the discussion

hopefully the information C# Program which calculated factorial to prime function can be useful for you in looking for references about technology gadgets,

you just finished reading information about C# Program which calculated factorial to prime function if you want to bookmark or share this link please use link https://indiafunworld.blogspot.com/2014/01/c-program-which-calculated-factorial-to.html please also visit to other page to get more information.

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

Related : C# Program which calculated factorial to prime function

0 komentar:

Posting Komentar