Here's the whole code:
Code:
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
int main()
{
FILE *f;
f = fopen("we.txt","r");
if (f) {
printf ("\The file connot be opened.\n");
return -1;
}
while (!feof(f)) {
int number_ofnumbers=0;
char c;
fscanf(f,"%c", &c);
if (c=='\0')
number_ofnumbers++;
int a[number_ofnumbers];
int i;
for (i=0; i<number_ofnumbers; i++)
{
int j;
int k=0;
int b[100];
if (a[i]>1)
{
for(j=2; j<=sqrt(a[i]); j++)
while ((a[i]% j) == 0)
{
if (sqrt(a[i]) != j)
{
k++;
b[k] = a[i];
}
else
{
k++;
b[k] = j;
}
}
FILE *f2;
int z;
f2 = fopen("output.txt", "r");
for(z = 0; z < k; z++){
fputs("b[z]",f2);
}
}
}
}
fclose (f);
return 0;
}