Please give me code for the following :
The program should take one file as input which contains integers and should take it into a int variable. lets say, print that variable on the screen.
I wrote the following code but its showing errors..
The programming is functioning when I replace these int types with char type but I need integers not characters.Code:# include <stdio.h> int main (int argc, int argv[1] ) { FILE *file_num ; int num ; file_num = fopen (argv[1],"r"); if (!file_num) printf ("File not found\n"); fscanf (file_num,"%d",&num); printf("%d",num); return ; }



2Likes
LinkBack URL
About LinkBacks



