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

Thread Solved
Reply

Join Date: Feb 2008
Posts: 1,592
Reputation: jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of 
Solved Threads: 120
jephthah's Avatar
jephthah jephthah is offline Offline
Posting Virtuoso

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

 
0
  #11
Jul 3rd, 2009
Originally Posted by jephthah View Post
%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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 90
Reputation: ajay.krish123 is an unknown quantity at this point 
Solved Threads: 8
ajay.krish123 ajay.krish123 is offline Offline
Junior Poster in Training

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

 
0
  #12
Jul 3rd, 2009
the meaning of
  1. sum+=i;
is same as the
  1. sum=sum+i;
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC