What wrong in this code?
#include <stdio.h> int main() { int n,num,i; FILE *fp, *fpo, *fpe; fp=fopen("main.dat","w"); printf("how many numbers?"); scanf("%d",&n); printf("enter the number now"); for(i=0;i<n;i++) { scanf("%d",&num); putw(num,fp); } fclose(fp); fp=fopen("main.dat","r"); fpo=fopen("odd.dat","w"); fpe=fopen("even.dat","w"); for(i=0;i<n;i++) { num=getw(fp); if(num==0) putw(num,fpe); else putw(num,fpo); fp=fopen("main.dat","r"), printf("content from main file"); while(num=getw(fp)!=EOF) printf("%d\t",num); fclose(fp); fp=fopen("odd.dat","r"); printf("content from odd file"); while(num=getw(fpo)!=EOF) printf("%d\t",num); fclose(fpe); fp=fopen("even.dat","r"); printf("content from even file"); while(num=getw(fpe)!=EOF) printf("%d\t",num); fclose(fpe); return 0; }