1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
GrogVix [38]
3 years ago
10

Write a program which can do a String Check if its Panagram or not!

Computers and Technology
1 answer:
slega [8]3 years ago
3 0

Answer:

#include <bits/stdc++.h>

using namespace std;

bool isPangram(string &s) //boolean function to check whether the string is pangram or not...

{

 int a[26]={0};//initializing the array a with zero.

   for(int i=0;i<s.length();i++)

   {

       if(s[i]>='A' && s[i] <= 'Z') //checking for uppercase letters..

       {

           a[s[i]-'A']++;

       }

       else if(s[i]>='a' && s[i] <= 'z')//checking for lowercase letters..

       {

           a[s[i]-'a']++;

       }

   }

   for(int i=0;i<26;i++)//if any value of array a is zero then returning false.

   {

       if(a[i]==0)

       return false;

   }

   return true;

}

int main() {

   string s;

   getline(cin,s);

   bool b=isPangram(s);

   cout<<b<<endl;

return 0;

}

Input:-

abcdefghijklmnopqrstuvwxy z

Output:-

1

Explanation:

Pangram string is a string that contains all the alphabetical letters form a to z.So the above program returns 1 if the string is Pangram and 0 if the string is not pangram.

I have used a function called isPangram of type boolean.In the function I have taken an array of size 26 and initialized it with 0.Then iterating over the string and updating the count in the array a.Then checking if any value in the array a is zero if it is then the answer is false else it is true.

You might be interested in
Subscribe to my you tube channel to get all your questions answered
vredina [299]

kaaaaaaaaaaaaaaaaa

aaa

4 0
3 years ago
Blogs are typically written by large companies or organizations as a way to express formal, technical, or scholarly information
Vikentia [17]

This is not really true, so is this supposed to be like a true or false question? If so then I would say this is false, because a lot of smaller people post on blogs it is not all typically large companies or organizations.

5 0
3 years ago
Question
LuckyWell [14K]

Answer:

you go to the what ever you use for the stuff i thing you want

Explanation:

6 0
3 years ago
True or false? The following deterministic finite-state automaton recognizes the set of all bit strings such that the first bit
aleksklad [387]

Answer:gjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

Explanation:

7 0
3 years ago
A prime number is an integer greater than 1 that is evenly divisible by only 1 and itself. For example, the number 5 is prime be
Natasha_Volkova [10]

Answer:

Since no programming language is stated, python will by used.

Explanation:

def  isPrime():

#first we ask for a number that will be tested

   data= int(input("please enter a number"))

#the next line is where the number will be tested to see if its a prime

   if (data>1):

       if(data % 2)==1:

           print("true")

       else:

           print("False")

   else:

       print("Enter a number greater than 1")

isPrime()

3 0
4 years ago
Read 2 more answers
Other questions:
  • What is the circular motion that the earth makes in its orbit around the sun
    14·1 answer
  • I need help to find out what is wrong with this program and my variable, "exponent" comes out as 0 in the output instead of the
    14·1 answer
  • An insulated rigid tank is divided into two equal parts by a partition. Initially, one part contains 4 kg of an ideal gas at 850
    8·1 answer
  • Assume that an int variable age has been declared and already given a value and assume that a char variable choice has been decl
    9·1 answer
  • Will there be a season 3 of Gravity Falls?
    5·2 answers
  • . A double is more precise than a float... true or false?
    12·1 answer
  • Administrators who are wary of using the same tools that attackers use should remember that a tool that can help close an open o
    6·1 answer
  • What symbol is used for an assignment statement in a flowchart?
    8·1 answer
  • The leader in student travel who provides educational tours at affordable prices is called?
    8·1 answer
  • Lol fortnite really going UwU and anime
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!