#include <stdio.h>
//datafile.txt contains 2 4 67 89 3.4 G
void main()
{
	int thenumber[4];
	float thetemp;
	char myletter;
	int i;
	FILE *fp;

	fp = fopen("datafile.txt", "r");//open for read

	//-------------------read from file--------------------
	for (i = 0;i <= 3;i++)
	{
		fscanf(fp, "%d", &thenumber[i]);//read in to memory
	}
	fscanf(fp, "%f", &thetemp);//read float from file
	fscanf(fp, " %c", &myletter);//read character from file
	fclose(fp);					//close file

	//---------------------print to screen----------------
	for (i = 0;i <= 3;i++)
	{
		printf("%d ", thenumber[i]);//print array on screen
	}
	printf("%.2f ", thetemp);//print float
	printf("%c ", myletter);//print char
	printf("\n\n");
}