Computer Science, asked by thebiggguy, 10 months ago

WAP in JAVA to check if all alphabets are present or not.


thebiggguy: Best will get BRAINLIEST.
rakeshchennupati143: r u even alive?

Answers

Answered by jyotirmaykrjha
1

import java.util.*;

class alpha

{

   public static void  main(String args[])

   {

       Scanner sc=new Scanner(System.in);

       System.out.print("Enter a sentence : ");

       String input = sc.nextLine();

       int l = input.length();

       boolean res = false;

       if(l<26)

       {

           System.out.print("Not possible :-(");

           System.exit(0);

       }

       for(char ch='A';ch <= 'Z';ch++)

       {

           if (input.indexOf(ch) < 0 && input.indexOf((char) (ch + 32)) < 0)

           {

               res=false;

           }

           else

           {

               res=true;

           }

       }

       if(res=true)

       {

           System.out.print("All alphabets contained.");

       }

       else

       {

           System.out.print("All alphabets not present.");

       }

   }

}


rakeshchennupati143: your program is wrong
rakeshchennupati143: i can prove it
rakeshchennupati143: compile the program and give string as "abcdefghijklmnopqrstuvwxya"
rakeshchennupati143: note i did not give "z" in the string
rakeshchennupati143: the output will be "all alphabets are contained"
rakeshchennupati143: so it is wrong
jyotirmaykrjha: This is my screenshot...
rakeshchennupati143: what ?
Answered by ceta
0

Answer:

hey you can get it on stackoverflow

Explanation:

if you need any other check it in stackoverflow

Similar questions