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

  • How to become a Computer ProgrammerComputer programming, also known as programming, coding, or software development (there are subtle differences between each term), is the process of “writing instruction ...
  • Google Analytics for Windows PhoneUpdate (9/2/12): I have created a nuget package which makes instrumenting an app even easier. Check it out here.Last week I gave a talk on Google Analytics for Windows P ...
  • C# Main Function for Calling all classes http://maxyaquos.blogspot.com /2014/02/c-main-function-for-calling-all-classes.html" rel="nofollow" target="_blank">C# Main Function for Calling all classes void Main_F ...
  • C# program to print nth iteration using loopsC# program to print 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 . . . nth iterationProblem Statement:Write a program using loop which prints the following output.1 2 2 3 3 ...
  • HOW TO SIMULATE A BOUNCING BALL USING C++HEllo!!Bouncing ball simulation is really interesting in C++. It uses the header file <graphics.h> for drawing the ball, and here we also use http://maxyaquo ...

0 komentar:

Posting Komentar