Learn2progWikkaSite : NsdPrimzahlen

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register



@start struktogramm main
Struktogramm could be a Function
main( )
{
@* Declarations *
int zahl ;
int i = 4 ;

@* Program *
Input: zahl
while (i < zahl)
{
if (isPrimzahl(i))
Msg:Diese Zahl ist eine Primzahl:
Output: i
i = i +1;
}
}
@end struktogramm
@start struktogramm isPrimzahl
Struktogramm could be a Function
isPrimzahl( int zahl )
{
@* Declarations *
int j ;

@* Program *
j = 2;
while (j < zahl)
{
if (zahl % j
0) return 0;
else
j = j +1;
}
return 1;
}
@end struktogramm

Categories
CategoryNsd

There is one comment on this page. [Display comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.3