if char c2='a' , c3='A', c4; c4=c2-c3; printf("the difference between capital letters and small letters is:%d\n",(int)c4); ... what is the effect of putting int before c4 ??
You might want to look up "casting" in your C book.
it will print the ascci code not the letters itself
right ?
it should
should what ! , why don't any one here easily write the answer or just say i don't know !!
OS is not here to provide you answers, OS is here to help you learn and garner the answer for yourself.
it should print the ascii code, but i am not sure...try to run the code. i agree with @eSpeX
sir i have just started learning the c language self learning and the comp. in not working & it's just a little new thing in a very very long code , and i just want to check if it right or not , and of course if the compilar had been working i wouldn't have the pleasure of asking you :)
ok 1st of all relax :P i am not an expert also..actually my skills go back to 7-8 years ago...plus do not have the compiler...trying to write as java and run it :) give some time :) ps not a sir :P
haha my skills go for a week ago :)
try rerunning but initialize c4 as int ,not char. tell me if it helps
char c2='a',c3='A'; int c4; //c4= 'a'-'A'; c4= (int)c2 -(int)c3; System.out.println(c4); something like this (this is java code)
another question please , would you please tell me the logical order of the opertators . is that order right () */% +- <=>= == != && || += -= /= *= ?
Before you spend a great deal of time on this, what are you trying to accomplish?
the value for 8/10*9%10 =10 ?
i try to find the diff between visual basic language and c alnguage
sir , micro , you made my day
There are a great many differences between C and basic. Are you trying to accomplish a specific task with the OP code?
but i am asking for the priority
no just learnig what i need to learn
any parenthesis to know the order or like u wrote it?
Well trying to do mathematical operations on chars is not a very effective way to learn. I would suggest you start with a goal and work toward that end.
snx sir
no just i wrote it , is the order right ?
the value for 8/10*9%10 =0
What you wrote will first divide 8 by 10, then multiply it by 9, then modulus the result with 10, which should not give you a remainder of 10.
the link for precedence @eSpeX gave you is great and easy to read. try recalculating the exsample you gave us so you can see why it is 0 and not 10.
sry i was suppose to write 0 :D
it will be 10*9=90 then 8/90 for int value zero then reminder of 0 %10 is zerp :D
yes :D
while i am writing a code is there any diff between ++b and b++
yes the precedence in which they increment. sec ill find a good link for you
look at this part of code
int main() {int i=3; int j=9; int k=2; int m,n,o; m= ++i %k+j; printf("i=%d\nj=%d\n k=%d m=%d\n",i,j,k,m); n=j%i+m-- ; printf("i=%d\nj=%d\nk=%d\nn=%d\n",i,j,k,n); k+=8; printf("i=%d\nj=%d\nk=%d\n",i,j,k ); o=n/k*m%k; printf("i=%d\nj=%d\nk=%d\no=%d",i,j,k,o); getch () ; return 0; }
http://stackoverflow.com/questions/24853/what-is-the-difference-between-i-and-i
it asks me in a problem to do such so , but i it keep saying that i=4 while i give it 3 to him , is that a generousness from c langiage :D
++i well it is being incremented so yes it should be 4.
ahm , so when i write m=++i it= m=i+1 ?
yes
ahh and if i write i=9 , and m=i-- it gives me i=8 but m = 9
yes that is because i-- will decrement the value of i, but return the pre-decremented value.
check the link i previously sent you
i got it
you made my day thank you , a 8 hours of studying ending by a person like you . is just great :)
heh very kind of you saying this :) good luck with your studies :) i am studying myself (java)
my college mate has just ending study it , if you want anything he would like to help you ofc :)
thank you . very nice of him :)
You may want to take a look at http://www.softintegration.com . They have a good C/C++ interpreter which would be perfect for this type of experiment.
snx alot @rsmith6559
Join our real-time social learning platform and learn together with your friends!