943,962 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Marked Solved
  • Views: 950
  • C RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Jul 3rd, 2009
0

Re: adding from 0 to a number that will be entered by the user .

Click to Expand / Collapse  Quote originally posted by jephthah ...
%i and %d are equivalent. both of them specify the format for a signed decimal integer, and either are acceptable to use
just as an afterthought, i should clarify that the above statement is only strictly true for "printf()"

for "scanf()", the %d and %i are subtly different ... %d requires a decimal (base 10) integer input, while %i assumes decimal by default, but will also read number as octal if it is prefixed by '0', or hexadecimal if prefixed by '0x' or '0X'
Last edited by jephthah; Jul 3rd, 2009 at 12:06 am.
Reputation Points: 2143
Solved Threads: 178
Posting Maven
jephthah is offline Offline
2,567 posts
since Feb 2008
Jul 3rd, 2009
0

Re: adding from 0 to a number that will be entered by the user .

the meaning of
  1. sum+=i;
is same as the
  1. sum=sum+i;
Reputation Points: 6
Solved Threads: 9
Junior Poster in Training
ajay.krish123 is offline Offline
90 posts
since Nov 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: help to work on structures..
Next Thread in C Forum Timeline: extract multidigits from a char* (substring)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC