{"id":3960,"date":"2021-11-06T12:07:04","date_gmt":"2021-11-06T12:07:04","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=3960"},"modified":"2021-11-06T12:10:44","modified_gmt":"2021-11-06T12:10:44","slug":"writing-an-array-of-numbers-in-a-file-in-c","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/writing-an-array-of-numbers-in-a-file-in-c\/21934.html","title":{"rendered":"Writing An Array Of Numbers In A File In C."},"content":{"rendered":"<p>hi<br \/>\ni want to write an array of numbers (for example from 0 to 14) in a file<br \/>\nthe source is something like that:<br \/>\nFILE *fp;<br \/>\nfp=fopen(&#8220;output.txt&#8221;,&#8221;w&#8221;);<br \/>\nfor(int i=0;i&lt;15;i++)<br \/>\n{a[i]=i;<\/p>\n<p>fprintf(fp,&#8221;%f\\n&#8221;,a[i]);<br \/>\n}<br \/>\nfclose(fp);<br \/>\nno output is printed.can anybody say what is the problem?<\/p>\n<p>when i open the text file the output is there.<br \/>\nBut it is not appearing in the output page when i run the program.<br \/>\nthe function of fprintf statement is suppose to print output in both. is&#8217;nt it ?<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":7},"question-category":[55],"question_tags":[],"class_list":["post-3960","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/3960","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=3960"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=3960"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=3960"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=3960"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}