Running Into a problem here...Help Needed
Well problem one consists of my program not writing its actions down to the file where I told it to. I checked and checked again; I seem to have the right codes maybe in the wrong order though...
EDIT:Well I just fixed one of the problem stil can't get this thing to print to the txt though.
#include <stdio.h>
#include <conio.h>
#include <math.h>
void main(void)
{
char c;
int N,x,iter = 1;
FILE *outptr;
outptr=fopen("myOutput.txt","wt");
printf("\nPlease enter a value for N ");
scanf("%i",&N);
printf("\n ");
for(x = N, iter = 0; x > 1; x--)
{
printf("%i", x);
printf(" + ");
iter = iter + x;
fprintf(outptr, "%i", x);
fprintf(outptr, " + ");
}
printf(" 1 = ");
printf("%i", iter);
getch();
fclose(outptr);