Help me out in solving (solved)
char str = "%d %c",arr="sololearn"; printf(str,0[arr],2[arr+3]); https://www.sololearn.com/post/460421/?ref=app
0[arr] is same as arr which value here is 's' ; Initially arr points to start or 0th element of array. And arr+3 means arr [say location is 1000] pointer added 3 positions farward, now points to arr pointer points to arr [location is 1003] which is 'o'. (note array points from 0 index). Now 2[arr] means arr, and the value is 'e'. [Since now start position is arr+3 is arr that is 'o'. So] And in printf %d coverts charecter value to ascci or numaric value of 's' which is 115. So Output is 115 e. Hope it clears you...
Santosh Chavan 0[arr] and arr both representing the zeroth index in this index value is S capital S and ASCII value of capital S is 83 so it will be 83 and the ASCII value of small s is 115 . Hope you understood.
It's the same as; char arr = "Sololearn"; printf("%d %c", arr, arr); Outputs 83 e 83 is the int value of 'S'
Here's an ascii chart. Look at the values in the Dec (base 10) ("%d") column, under the section printable characters, for the characters. Capital letters starting at 'A' with the value of 65, increasing by 1 in alphabetical order, range from 65-90. Lower case letters are +32 of their upper case counterparts, and range from 'a' 97 to 'z' 122. https://www.ascii-code.com/
83 for 'S' 115 for 's'
Santosh Chavan if it is small s in sololearn, Output is 115. If capital S as SoloLearn then output is 83. The ascii values of respected characters.
Thanks a lot Jayakrishna🇮🇳 ChaoticDawg 😊😊
See here Santosh Chavan Just remember 'A' - 'Z' is 65 to 65+25=90 And 'a' to 'z' is 97 to 97+25=122 https://ascii.cl/index.htm?content=mobile You're Wel come
ChaoticDawg do you mean 0[arr]=arr? and how is s value equals 83?
Thanks 🐍Sizuna 🐉