Max Gadget, GPG Dragon Latest Version, Install Android, Sony Xperia, Xiaomi Mi Robot Vacuum, Verizon, Android Marshmallow, Network, stock firmware

Selasa, 24 Desember 2013

C# Program to check number is prime or composite

C# Program to check number is prime or composite - this blog we have built a few years ago and already very many blog visitors Max Gadget who are satisfied with the information we convey and we say thanks for that, we will then improve the quality of information we convey to you, well according to what you are looking for we will now discuss first about C# Program to check number is prime or composite this information we framework from various trusted sources, please see:

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

}




so much information C# Program to check number is prime or composite

hopefully the information C# Program to check number is prime or composite that we convey can make you satisfied because it can be useful to determine the gadget according to your needs.

you just read the article titled C# Program to check number is prime or composite if you feel this information is useful and want to bookmark or share please use the link https://maxyaquos.blogspot.com/2013/12/c-program-to-check-number-is-prime-or.html do not forget to go back to this blog to get more information about gadgets.

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

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

0 komentar:

Posting Komentar