home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / PC_V11_B.LZH / DEMO_ASS / DEMO_ASS / C_ASM_C.C next >
C/C++ Source or Header  |  1991-09-20  |  706b  |  42 lines

  1. /* C_ASM.C
  2.    Demoprogramm zum Aufruf von Assemblerroutinen aus
  3.    C-Programmen und umgekehrt
  4. */
  5.  
  6. #include <stdio.h>
  7.  
  8. void SumMulFac( int x, int y );    /* definiert in ASM.S */
  9.  
  10.  
  11. void fakult( int x )
  12. {
  13.     double y;
  14.     int i;
  15.  
  16.     printf( "Die Fakultät von %d ist ", x );
  17.     if( x < 0 )
  18.     {
  19.         puts( "nicht definiert" );
  20.     }
  21.     else
  22.     {
  23.         for( i = 2, y = 1.0; i <= x; i++ )
  24.             y *= i;
  25.  
  26.         printf( "%lg\n", y );
  27.     }
  28. }
  29.  
  30. int main( void )
  31. {
  32.     int x, y;
  33.  
  34.     puts( "Bitte zwei Integerzahlen eingeben:" );
  35.     scanf( "%d %d", &x, &y );
  36.     SumMulFac( x, y );
  37.  
  38.     puts( "Bitte <RETURN> drücken" );
  39.     getchar();
  40.     return( 0 );
  41. }
  42.