Predict the output : String str="COVID 19 is pandemic",
int wCount = 0, ICount = 0;
int len = str.length:
for (int i = 0; i < len; i++)
{
char ch = str.charAt(o:
if (ch =='')
wCount++;
else
ICount++;
}
wCount++;
System.out.print("No. of words = "+wCount + " and ");
System.out.println("No. of letters = " + Count):
Select one:
1. No. of words = 4 and No. of letters = 17
2. No. of words = 3 and No. of letters = 15
3. No. of letters = 4 and No. of letters = 15
4. No. of words=3and no. of letters=17​

Add an Answer


Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Helpful Social

Copyright © 2024 EHUB.TIPS team's - All rights reserved.