Diandra Gadget, league soccer apk data, Samsung to iPhone, HUA Box Version, LAVA IRIS, Firmware Flash file and flash tool, Android KitKat, Lenovo, review Computer and Digital

C# Program to check number is prime or composite

C# Program to check number is prime or composite - lately we often hear a lot of new gadgets are released by famous brands that have a good spec, on the blog Diandra Gadget we will discuss about the review gagdet of all brands ranging from spek, price and how to use it, now we will discuss first about C# Program to check number is prime or composite please refer to the information we provide, because we have collected a lot of data to make this article to be complete for you:

Articles : C# Program to check number is prime or composite
full Link : C# Program to check number is prime or composite
Article Csharp, Article programming, Article programs,

You can also see our article on:


C# Program to check number is prime or composite

C# Program to check entered number is prime or composite 

Program Statement:
Write a program that takes an integer as an input from user and prints if it is a prime or composite number.

Solution:
 static void Main(string[] args)
{
int num, i;
Console.WriteLine("Enter the number to check number is prime or composite");
num=Convert.ToInt32(Console.ReadLine());
i = 2;
while (i <= num - 1)
{
if (num % i == 0)
{
Console.WriteLine("composite number: "+num);
break;
}
i++;
}
if (i == num)
Console.WriteLine("prime number: " + num);
Console.ReadLine();

}




quite so many infromation C# Program to check number is prime or composite

hopefully the information we provide about C# Program to check number is prime or composite can give more benefits for you in determining the gadget that suits your needs.

you just read the article with the title C# Program to check number is prime or composite if intend to bookmark bookmark or share please use link https://diandrakesling.blogspot.com/2013/12/c-program-to-check-number-is-prime-or.html to get more information about technology please visit other pages on this blog, thank you.

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

Related : C# Program to check number is prime or composite

0 komentar:

Posting Komentar