prime check in c
int isPrime(long long number) {
if (number == 0 || number == 1 || (number % 2 == 0 && number > 2)) {
return 0;
}
else {
for (long long i=3; i <= (long long)sqrt(number)+1; i++) {
if (number % i == 0) {
return 0;
}
}
return 1;
}
}
Also in C:
- c if int
- passing 2d array as parameter to function in c
- matrix pointer c
- scanf in c
- how to declare multidimensional array in c
- fgets c
- char to int c
- download youtube videos
- reverse function in c
- fwrite c
- how to pass an array to a thread in c?
- check if string in string c
- oop244
- plt hide axis ticks
- how to check where the last char is in a string c
- Route::resource
- print digits of a number in c
- #pragma pack(1) in c
- strtoul C
- how to break a loop in c
- powershell search big files
- how to make a linked list in c
- fopen c
- bootsrap textbox