Maxtron News, Android KitKat, stock firmware, Flash file, Lava iris, Ulefone Tiger, Mobile App, Marketing Tool, Infinix Stock Roms, Android Multi Tools Latest Version

C# Program to check number is prime or composite

C# Program to check number is prime or composite - for a long time we built this blog Maxtron News with the intention to advance the knowledge of the community about technological developments that continue to advance, because not everyone can enjoy the technology, so you will we present the technology news according to what you need, now we will discuss first about C# Program to check number is prime or composite please refer to the information we provide we feel quite complete because we summarize from reliable sources.

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

}




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

hopefully the article that we make this C# Program to check number is prime or composite can be useful for you in adding science about gadgets that continue to advance.

you just read the article with title C# Program to check number is prime or composite if you wish to bookmark or share it please use link https://katieandmaxtron.blogspot.com/2013/12/c-program-to-check-number-is-prime-or.html to get more information please visit our other blog page.

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

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

  • 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://katieand ...
  • Assembly Language Kip R Irvani Sixth EditionAssembly Language Kip R Irvani Sixth EditionAssembly Language Kip R Irvani Sixth Edition is one of the best book for students who study the course of Computer Organizati ...
  • Array Problem Solving using C#Array Problem Solving using C#Program Statement:Create two arrays student_rollno and student_marks, both of same size. First array will save the rollnos of students and ...
  • How do i begin learning code?Hello people! We Intelligent Computing are about to start a whole new section on Programming but before we start on that I would highly recommend you to read this articl ...
  • C# Program to Print ASCII values and characters using a while loopC# Program to Print ASCII values and their equivalent characters using a while loopProblem Statement:Write a program to print all the ASCII values and their equivalent c ...

0 komentar:

Posting Komentar