SHARE
TWEET

Untitled

a guest Oct 18th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int k;
  6.     for (k = 2; k < 200000; k++)
  7.     {
  8.         if (isPrime(k))
  9.         {
  10.             printf("X");
  11.         } else {
  12.             printf("O");
  13.         }
  14.     }  
  15. }
  16.  
  17. int isPrime(int number)
  18. {
  19.    int i;
  20.    for (i = 2; i < number; i++ )
  21.    {
  22.        if (number % i == 0)
  23.        {
  24.            return 0;
  25.        }
  26.    }
  27.    return 1;
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top