Gadget Miracles, Tracfone LG Smartphone Comparison, Android Jelly Bean, Flash tool, Avengers Box, Ulefone, samsung, iphone, Infinix and stock firmware

Selasa, 07 Januari 2014

C# Program to Print number of prime values in the array

C# Program to Print number of prime values in the array - I made this blog Gadget Miracles already a few years ago, although I am busy working in my office still build this blog for you who need information about gadgets, has very much information that we provide about the C# Program to Print number of prime values in the array which you are looking for at this time, please refer to the information we provide in full guarantee because I have collected a lot of information from the source of the richest:

Articles : C# Program to Print number of prime values in the array
full Link : C# Program to Print number of prime values in the array
Article Csharp, Article programs,

You can also see our article on:


C# Program to Print number of prime values in the array

C# Program to Print number of prime values in the array

Program Statement:
Write a program which takes 10 values from user in an array and then show the number of prime values in the array.

Solution:
 public class arr
{
int c, count = 0, n;
int[] array = new int[10];
public void arr_func()
{
Console.WriteLine("\n\t\tEnter 10 element only!\n");
for (int x = 0; x < 10; x++)
array[x] = Convert.ToInt32(Console.ReadLine());
for (int y = 0; y < 10; y++)
{
n = array[y];
for (c = 2; c <= n - 1; c++)
{
if (n % c == 0)
{ break; }
}

if (c == n)
{
count++;
Console.WriteLine("\n\t\t{0} is prime number!\n", n);
}
}
Console.WriteLine("\n\t\tNumber of prime values : {0}\n", count);
}
}




enough already information about C# Program to Print number of prime values in the array

hopefully the information C# Program to Print number of prime values in the array can give you answers to all your questions ayang is conveyed to google.

finished already information about C# Program to Print number of prime values in the array if you mers this information useful for you and want to bookmark or share please use link https://19miracles.blogspot.com/2014/01/c-program-to-print-number-of-prime.html

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

Related : C# Program to Print number of prime values in the array

  • C# Program to find Student GPA and CGPA || Concept of ENUM in C#C# Program to find Student GPA and CGPAProgram Statement:Create a class of student which stores characteristcs of student like studentID, studentName, studentDOB, studen ...
  • C# Program for Array solving problemsC# Program for Array solving problemsProgram Statement:Write a function which takes four arrays of same size as arguments; array1, array2, array3, array4. The function w ...
  • 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 o ...
  • C# Program to print Rectangle $C# Program to print Rectangle $Program Statement:Write a program using for loop which prints the following output on the screen.$$$$$$$$$$$$         ...
  • C# Program to find Area of TriangleC# Program to find Area of TriangleProgram Statement:If the lengths of the sides of a triangle are denoted by a, b, and c, then area of triangle is given byArea = SS(S- ...

0 komentar:

Posting Komentar