Here is a sample of code that does what I think you want it to:
Code:
#include <stdio.h>
void main( void )
{
// Your integer
int Integer;
// Your floating point number
float FloatingPoint;
// your file
FILE* File;
printf("Please enter an integer: ");
// read the integer;
scanf("%d", &Integer);
printf("Please enter a floating point number: ");
// read the floating point number
scanf("%f", &FloatingPoint);
// Open the file. The "w" opens the file for writing
File = fopen("exercise.txt", "w");
// Write the integer
fprintf(File, "%d ", Integer);
// Write the floating point number
fprintf(File, "%f", FloatingPoint);
// Close the file
fclose(File);
}
I hope that the code works. I don't have C on this computer so I didn't test it. lol. You might need another header file or something. Good Luck!