News Latest Technology, How to Fix Apple iPhone, contrast and brightness, Wireless Headphone, android KitKat stock firmware, XiaoMi Mi Pad, Tracfone Promo

Selasa, 24 Desember 2013

C# Program to check number is prime or composite

C# Program to check number is prime or composite - with more and more gadgets of new products, we should be literate technology because the product is made with the purpose to further facilitate our lives, on the blog News Latest Technology we will discuss about new and old products, we will explain the full pungsi, well now we will first clean up about C# Program to check number is prime or composite we have collected a lot of data to make this article so you do not deleted information. 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();

}




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 we provide can be useful for your life especially in determining the gadget according to your requirement.

just smell you finished reading the article about C# Program to check number is prime or composite if intend to share or just bookmark please use link https://memesmemosos.blogspot.com/2013/12/c-program-to-check-number-is-prime-or.html to get more information about gadget please visit other pages on this blog that we guarantee super complete.

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

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

0 komentar:

Posting Komentar