Computer Science, asked by shiwangi28, 1 year ago

what will be the output of the following segments? string s ="application"; int p =s.indexof('a'); system.out.println(p); system.out.println(p+s);​

Answers

Answered by sreeramanasp6k3fx
50

First of all there are plenty of mistakes in the code.

The correct code is :

String s="application";

int p=s.indexOf('a'); // p gets value '0'

System.out.println(p);

System.out.println(p+s);

Output:

0

0application

Pl mark brainliest if satisfied............


sreeramanasp6k3fx: ICSE ?
sreeramanasp6k3fx: Which school ?
shiwangi28: icse constancia school
rishitgrg: Hi shivangi
Answered by ami14042029
4

Answer:

0

0application

Explanation:

the index of a is 0 so first 0 is printed

in the next print case p+s is there so 0application

Similar questions