printf - C Programming - integer value printing incorrectly -


I am using Borreland C v3.1 (DOS version)

This is my code

P>

  contains # lt; Stdio.h & gt; #to & lt include, conio.h & gt; Zero WTF () {int array [15], i; Int. WTF_NUMBER = 12345; For (i = 0; i & lt; 16; i ++) array [i] = 0; Printf ("% d", WTF_NUMBER); } Zero main () {clrscr (); WTF (); Getch (); }  

I should get 12345 as output, but I'm getting 0 instead. help.

Your code is incorrect

for

< For the code> (i = 0; i

Because you have only 15 elements in your array I

for (i = 0; i <-15; i ++) array [ I] = 0;


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -