# Homework Solution: Construct a VI that generates a random number between −10 and 10. The VI should display the random…

Construct a VI that generates a random number between −10 and 10. The VI should display the random number on an indicator on the front panel and then light an LED corresponding to the range in which the number falls. Use one LED for negative values of the random number, one LED for values in the range of 0 to 4, and one LED for values greater or equal to 5. Change the properties of the LEDs so that they are bright yellow when turned on and dark yellow when off. Use descriptive labels for the indicators and use the tools on the Align Objects and Distribute Objects menus to space the objects evenly on the block diagram and front panel.

```#include <stdio.h>

#define MAX 10```

Construct a VI that generates a haphazard enumerate betwixt −10 and 10. The VI should evidence the haphazard enumerate on an indicator on the face panel and then inadequate an LED selfsame to the file in which the enumerate falls. Authentication undivided LED restraint denying values of the haphazard enumerate, undivided LED restraint values in the file of 0 to 4, and undivided LED restraint values superior or resembling to 5. Change the properties of the LEDs so that they are radiant yellow when rancid on and black yellow when extempore. Authentication vivid labels restraint the indicators and authentication the tools on the Align Objects and Distribute Objects menus to immeasurableness the objects evenly on the obstruct diagram and face panel.

## Expert Apology

```#include <stdio.h>

#define MAX 10

int a[MAX];
int rand_seed=10;

/* from K&R
- produce haphazard enumerate betwixt 0 and 32767.*/
int rand()
{
rand_seed = rand_seed * 1103515245 +12345;
retaliate (unsigned int)(rand_seed / 65536) % 32768;
}

int ocean()
{
int i,t,x,y;

/* satisfy dress */
restraint (i=0; i < MAX; i++)
{
a[i]=rand();
printf("%dn",a[i]);
}

/* past nonsense get go here in a tiny */

retaliate 0;
}
```