Ask a Question | Answer a Question! |
Submitting your question...
ResFinder - Thousands of Practice Papers
Guys, this is important...
There is a concept which has been ignored and not at all taken into consideration in programs.
If char ch=(char)65;
Then ch is ‘A’
With the same concept,
If char ch=(char)48;
Then ch is ‘0’( zero) and not 48!
This concept can be implied in program.One such example is as follows:
I am lazy to right the whole thing, this is just the program segment-
String m;// Input
int pos=0;
char ch;
Get the input!
l=m.length();
for(int i=0;i<l;i++)
{ ch=m.charAt(i);
pos=(int)ch-48;
System.out.println(pos*2);
}
If the input is “243”
Then the output should be: 4
8
6 |
|
asked by Prateek Mukherjee (prat172) 6 years ago |
4 |
Other Questions on This Topic
I miss the old res papers and the friends you could make here. |
|
asked by Joseph Chennattu (joseph444) 27 days ago |
2 |
What is the difference between steam turbines and gas turbines? |
|
asked by Yogesh (yogesh) 44 days ago |
1 |
+ 5 more questions by yogesh
who is jessica's father in merchant of venice? |
|
asked by Yogesh (yogesh) 74 days ago |
1 |
What is "how are you" in French? |
|
asked by Yogesh (yogesh) 74 days ago |
1 |
What is the boiling point of water at 2 bar? |
|
asked by Yogesh (yogesh) 202 days ago |
1 |
The organ of Corti is present on the
a. Basilar membrane of the median canal
b. Tectorial membrane of the median canal
c. Tectorial membrane of the vestibular canal
d. Basilar membrane of the tympanal canal |
|
asked by Yogesh (yogesh) 1 year ago |
2 |
Who was the president of USA during WWII? |
|
asked by Yogesh (yogesh) 1 year ago |
1 |
I've got an endsem exam in an hour but all I am doing is reading old threads on res. 🥲 |
|
asked by Nisarg Bhavsar (nisarg71) 58 days ago |
3 |
Hlooo..itzz been longgg...ICSE 2018 batch anybody?? |
|
asked by Snigdha (silver2002) 108 days ago |
3 |
tips and tricks to answer dialogue in french |
|
asked by french123 218 days ago |
0 |
physics icse prelim |
|
asked by Bananachips (bananachips) 1 year ago |
0 |
who was daughter of shylock |
|
asked by Ansh Anand (teleansh) 1 year ago |
3 |
what is Lenz law |
|
asked by Nidhi Mohunta (samairamohunta) 1 year ago |
1 |
A body of mass 0.2 kg falls from a height of 10 m to a height of 6 m above the ground. Find the loss in potential energy taking place in the body. Let g = 10 m/s². |
|
asked by ICSE (icse) 1 year ago |
1 |
|