-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram211.java
More file actions
43 lines (33 loc) · 830 Bytes
/
Copy pathprogram211.java
File metadata and controls
43 lines (33 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import java.util.Scanner;
class MarvellousString
{
public String str;
public int CountSmall()
{
char Arr[] = str.toCharArray();
int iCnt = 0;
int iCount = 0;
for(iCnt = 0 ; iCnt < Arr.length;iCnt++)
{
if((Arr[iCnt] >= 'a') && (Arr[iCnt] <= 'z'))
{
iCount++;
}
}
return iCount;
}
}
class program211
{
public static void main(String A[] )
{
Scanner Sobj = new Scanner(System.in);
System.out.println("Enter the String");
String data = Sobj.nextLine();
MarvellousString mobj = new MarvellousString();
mobj.str= data;
int iRet = 0;
iRet = mobj.CountSmall();
System.out.println("Number of small characters are :"+ iRet);
}
}