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
Filtering is a function of _____.
Levart [38]
The answer is: switches.

Explanation:

Filtering is a function of switches.
3 0
2 years ago
You have a Mobile Legends account???<br>Can I play with You???​
yulyashka [42]

Answer:

yes oo you want to play with me

7 0
2 years ago
You are finally at the stage of the software life cycle where you begin programming. What is this stage called?
nataly862011 [7]
You are finally at the stage of the software life cycle where you begin programming. What is this stage called?

development

5 0
2 years ago
An Acceptable Use Policy (AUP) are designed for the purpose of _____.
Vladimir79 [104]

Answer:

maximizing processing power

7 0
2 years ago
Which of the following is not a valid FICO Credit score?
kumpel [21]

Answer: C 475

Explanation:  These choices are A. 375, B. 276, and D. 575. so that wolde mean it would be C 475.

8 0
3 years ago
Read 2 more answers
Other questions:
  • What is the term for a male reproductive cell?​
    14·1 answer
  • What are 3 characteristics of syndrome E?
    13·1 answer
  • __________ was the first operating system to integrate security as its core functions.
    15·2 answers
  • The shortest compressed format of the ipv6 address 2001:0db8:0000:1470:0000:0000:0000:0200 is
    6·1 answer
  • Basic rule for java languague
    13·2 answers
  • The concept of "plug and play" is demonstrated by which of the following<br> scenarios?
    13·1 answer
  • What TCP message will be generated for an incoming SYN request for which is there no matching LISTENING port
    15·1 answer
  • Monster Collector
    7·1 answer
  • If a company gave you a free version of their software and encouraged you to try and improve it and share it with the only commu
    8·1 answer
  • Who designed the apple i computer in 1976?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!