Skip to content

Instantly share code, notes, and snippets.

@fliiiix
Created April 21, 2013 20:07
Show Gist options
  • Save fliiiix/5430894 to your computer and use it in GitHub Desktop.
Save fliiiix/5430894 to your computer and use it in GitHub Desktop.
Do What the Fuck You Want to Public License
/*******************************************************************************
*
*
* 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