Computer Science, asked by shreyamahajan, 1 year ago

what is the output of the last line of the question in image

Attachments:

Answers

Answered by siddhartharao77
1
Here is the output of the above-written code:


Today i Holiday.


Hope this helps!


shreyamahajan: 0 hai naa
shreyamahajan: bolo
siddhartharao77: T is 0
shreyamahajan: then i will be 6 it means we will take 1less than end index of what is asked
shreyamahajan: haina
shreyamahajan: akhri baar plz bata do
siddhartharao77: I think are very much confused. Let me explain u clearly. In java the starting index always starts with 0. The end index starts from 1. Here (0,7) = 0(T),1(o),2(d),3(a),4(y),5(space), 6(i), 7(T). Now, U understood right. Here the what happensis as i said the end string returns 1. So It displays upto 6 only. That is from T to i. Thats it.
siddhartharao77: In simple here 7 means The endpoint - 1.
shreyamahajan: yaa thanks i was confused only in this substring rest i know thanks for your help
shreyamahajan: thank you
Similar questions
Math, 1 year ago