Click here to Skip to main content
16,015,623 members
Home / Discussions / C#
   

C#

 
GeneralRe: Creating databases programmatically Pin
Jacob Dixon26-Jan-08 12:17
Jacob Dixon26-Jan-08 12:17 
GeneralRe: Creating databases programmatically Pin
Paul Conrad26-Jan-08 12:20
professionalPaul Conrad26-Jan-08 12:20 
GeneralRe: Creating databases programmatically Pin
Jacob Dixon26-Jan-08 12:23
Jacob Dixon26-Jan-08 12:23 
GeneralRe: Creating databases programmatically Pin
Paul Conrad26-Jan-08 12:24
professionalPaul Conrad26-Jan-08 12:24 
GeneralRe: Creating databases programmatically Pin
Sourie27-Jan-08 23:39
Sourie27-Jan-08 23:39 
GeneralI need help with prime numbers. Pin
Alex50126-Jan-08 11:03
Alex50126-Jan-08 11:03 
GeneralRe: I need help with prime numbers. Pin
Paul Conrad26-Jan-08 12:10
professionalPaul Conrad26-Jan-08 12:10 
GeneralRe: I need help with prime numbers. Pin
DaveyM6926-Jan-08 12:51
professionalDaveyM6926-Jan-08 12:51 
There's something pretty screwy going on in that code. You can adapt this to suit your needs...
static void Main(string[] args)
{
    Console.Write("Enter any integer: ");
    int inputValue;
    int.TryParse(Console.ReadLine(), out inputValue);
    if (isPrimeNumber(inputValue))
    {
        Console.WriteLine(inputValue + " is a prime number.");
    }
    else
    {
        Console.WriteLine(inputValue + " is not a prime number.");
    }
    Console.Write("Any key to exit... ");
    Console.ReadKey();
}

public static bool isPrimeNumber(int num)
{
    if (num < 2)
    {
        return false;
    }
    for (int i = 2; i < num; i++)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
    return true;
}

Paul... I'm not doing his homework - he was nearly there by himself (unless that was a non working example that he was given to fix)
GeneralRe: I need help with prime numbers. Pin
Paul Conrad26-Jan-08 13:12
professionalPaul Conrad26-Jan-08 13:12 
GeneralRe: I need help with prime numbers. Pin
Luc Pattyn26-Jan-08 14:51
sitebuilderLuc Pattyn26-Jan-08 14:51 
GeneralRe: I need help with prime numbers. Pin
Alex50126-Jan-08 18:05
Alex50126-Jan-08 18:05 
GeneralRe: I need help with prime numbers. Pin
GuyThiebaut26-Jan-08 13:18
professionalGuyThiebaut26-Jan-08 13:18 
GeneralRe: I need help with prime numbers. Pin
Luc Pattyn26-Jan-08 14:52
sitebuilderLuc Pattyn26-Jan-08 14:52 
GeneralRe: I need help with prime numbers. Pin
GuyThiebaut26-Jan-08 22:52
professionalGuyThiebaut26-Jan-08 22:52 
GeneralRe: I need help with prime numbers. Pin
Alex50126-Jan-08 18:13
Alex50126-Jan-08 18:13 
GeneralRe: I need help with prime numbers. Pin
PIEBALDconsult26-Jan-08 15:57
mvePIEBALDconsult26-Jan-08 15:57 
GeneralRe: I need help with prime numbers. Pin
Luc Pattyn26-Jan-08 16:18
sitebuilderLuc Pattyn26-Jan-08 16:18 
GeneralIC Programmer with C#. Pin
hdv21226-Jan-08 8:20
hdv21226-Jan-08 8:20 
GeneralRe: IC Programmer with C#. Pin
DaveyM6926-Jan-08 8:37
professionalDaveyM6926-Jan-08 8:37 
GeneralRe: IC Programmer with C#. Pin
Spacix One26-Jan-08 9:19
Spacix One26-Jan-08 9:19 
GeneralRe: IC Programmer with C#. Pin
hdv21226-Jan-08 11:02
hdv21226-Jan-08 11:02 
Questioncreating logger based on threads and queue Pin
kriskris26-Jan-08 3:43
kriskris26-Jan-08 3:43 
GeneralRe: creating logger based on threads and queue Pin
Paul Conrad26-Jan-08 5:42
professionalPaul Conrad26-Jan-08 5:42 
GeneralRe: creating logger based on threads and queue Pin
Adeel Chaudhry26-Jan-08 6:29
Adeel Chaudhry26-Jan-08 6:29 
GeneralAppDomain with non domain-neutral assemblies Pin
Softbal26-Jan-08 3:25
Softbal26-Jan-08 3:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.