1) You need to define FILE, etc. with #include <stdio.h> 2) %f is floating point numbers. You want %d for integers. 3) Why bother with the array, if you're just printing the numbers? Is this just a small fragment of the code? 4) "w" for the mode is fine. No need for "w+", as it's a once-through write of a fresh file.
ya it s just a fragment. here the problem is when i open the text file the output is there. But it is not appearing in the output page when i run the program. the function of fprintf statement is suppose to print output in both. is'nt it ?
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this
site. Computing.Net and Purch hereby disclaim all responsibility
and liability for the content of Computing.Net and its accuracy.