Created
April 21, 2013 20:07
-
-
Save fliiiix/5430894 to your computer and use it in GitHub Desktop.
Do What the Fuck You Want to Public License
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
* | |
* | |
* Beschreibung: Diese Programm kann zufällige zahlen Generieren. | |
* | |
* Benötigte Libraries: | |
* - stdlib.h | |
* - stdio.h | |
* | |
* Do What the Fuck You Want to Public License | |
*******************************************************************************/ | |
/*** Include Files ***********************************************************/ | |
#include <stdlib.h> /* Funktionsbibliothek: Hilfsfunktionen */ | |
#include <stdio.h> /* Funktionsbibliothek: Standard Ein- Ausgabe */ | |
/*** Globale Deklarationen und Definitionen **********************************/ | |
/*** Funktions-Deklarationen *************************************************/ | |
char istPrimzahl(int Zahl) | |
{ | |
char IstPrimzahl = 1; | |
int TestZahl = 2; | |
for(TestZahl = 2; TestZahl <= Zahl -1; TestZahl++) | |
{ | |
if(Zahl % TestZahl == 0) | |
{ | |
IstPrimzahl = 0; | |
} | |
} | |
return IstPrimzahl; | |
} | |
/******************************************************************************* | |
******************************* HAUPTPROGRAMM ********************************** | |
*******************************************************************************/ | |
int main(void) | |
{ | |
/* Intro */ | |
printf("1:%d \n", istPrimzahl(1)); | |
/*Main Function*/ | |
system("PAUSE"); | |
return (0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment