Agilent Technologies VEE Pro Uživatelská příručka Strana 33

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 602
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 32
Introduction
VEE Pro User’s Guide 5
Figure I-1. The “Random” Program in ANSI C
Figure I- 2 shows the same program in VEE.
/* Program to find maximum element in array */
#include <math.h>
main( )
{
double num[10],max;
int i;
for (i=0;i<10;i++){
num[i]=(double) rand( )/pow(2.0,15.0);
printf("%f/n",num[i];
}
max=num[0];
for {i=1;i<10;i++){
if (num[i]>max)max=num[i];
}
printf("/nmax; %f/n",max);
}
Zobrazit stránku 32
1 2 ... 28 29 30 31 32 33 34 35 36 37 38 ... 601 602

Komentáře k této Příručce

Žádné komentáře