package com; public class _index { public static void main(String[] args) { String s1="be proud to be an indian"; char ch=s1.charAt(s1.indexOf('e')); int count = 0; for(int i=0;i<s1.length();i++) { if(s1.charAt(i)=='e'){ System.out.println("number of E:=="+ch); count++; } } System.out.println("Total count of E:=="+count); } } rmtheis
- 5.5k
- 13
- 66
- 82