-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPangram.java
More file actions
63 lines (50 loc) · 931 Bytes
/
Pangram.java
File metadata and controls
63 lines (50 loc) · 931 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/// Check String is panagram or not(if present All Alphabet charcter is called panagram)
//Panagram String===== The quick brown fox jumps over the lazy dog
import java.util.*;
public class
{
public static void main(String[] args)
{
String s;
Scanner sc=new Scanner(System.in);
System.out.println(" Enter the String: ");
s=sc.nextLine();
System.out.println("");
s=s.replace(" ","");
char a[]=s.toCharArray();
int n=a.length;
int a2[]=new int[26];
int a3[]=new int[26];
int i=0;
// check ASCII code present in String or not
while(i!=n)
{
if(a[i]>='A' && a[i]<='Z')
{
int i2=a[i]-65;
a2[i2]=1;
}
if(a[i]>='a' && a[i]<='z')
{
int i3=a[i]-97;
a3[i3]=1;
}
++i;
}
i=0;
while(i!=26)
{
if(a2[i]==1 || a3[i]==1)
{
++i;
}
else
{
System.out.println("Not A Pangram !");
System.exit(0);
}
++i;
}
System.out.println("This Is A PanGram! ");
}
}