calcavg.cpp

来自「汇编&c语言code」· C++ 代码 · 共 28 行

CPP
28
字号
// Turbo Assembler    Copyright (c) 1991 By Borland International, Inc.

/* CALCAVG.CPP
   The C++ portion of an example of assembler code that calls
   a Borland C++ function in order to get a floating-point
   calculation performed.

*/

// From the Turbo Assembler Users Guide - Interfacing Turbo Assembler
//                                         with Borland C++

extern float Average(int far * ValuePtr, int NumberOfValues);
#define NUMBER_OF_TEST_VALUES 10
int TestValues[NUMBER_OF_TEST_VALUES] = {
   1, 2, 3, 4, 5, 6, 7, 8, 9, 10
};

main()
{
   printf("The average value is: %f\n",
          Average(TestValues, NUMBER_OF_TEST_VALUES));
}
float IntDivide(int Dividend, int Divisor)
{
   return( (float) Dividend / (float) Divisor );
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?