// july16ex2.cpp : Defines the entry point for the console application.
// creat random temps 32 - 212

#include "stdafx.h"
#include "stdlib.h"
#include "time.h"

int main(int argc, char* argv[])
{
    int num, minday, maxday;
	float ftemp, ctemp;
	float fmin, fmax;

	fmin = 999.0;
	fmax = -888.0;

	srand(time(NULL));

	for (num=1; num<= 1; num++) {

        ftemp = ((float) ( rand() % 1801 + 320)) / 10.0;
		ctemp = (ftemp - 32.0) * (5.0/9.0);

		if (ftemp < fmin) { fmin = ftemp;   minday=num;  }
		if (ftemp > fmax)   {fmax = ftemp;  maxday=num;   }

		printf("Day %d: The farenheit temp is %6.1f and the celsius %6.1f\n", num, ftemp, ctemp);
		

	}  /* end for num */

   printf("The min temp was %5.1f was found on day %d\n", fmin, minday);
   printf("The max temp was %5.1f  was found on day %d \n", fmax, maxday);

	return 0;
}