Answers for "panagram in c"

0

pangram program in c

//Pangram is string that contains all the alphabets in it
#include<stdio.h>
#include<ctype.h>

int main() {
    int arr[91]={0}, flag = 1;
    char c;
    while(scanf("%c",&c)==1){
        c = toupper(c);
        arr[(int)c]++;
    }
    for(int i=65; i<91;i++){
        if(arr[i]==0)
        flag = 0;
    }
    
    if(flag)printf("panagram");
    else printf("not panagram");
    
    return 0;
}
Posted by: Guest on June-29-2020
0

panagram in c

#include<stdio.h>
#include<conio.h>
void main()
{
    char str[100]="The quick brown fox jumps over the lazy dog";
    int i,value[26]={0},count=0;
    for(i=0;str[i]!='\0';i++)
    {
        if('a'<=str[i] && str[i]<='z')
        {
            count+=!value[str[i]-'a'];
            value[str[i]-'a']=1;
        }
        else if('A'<=str[i] && str[i]<='Z')
        {
            count+=!value[str[i]-'A'];
            value[str[i]-'A']=1;
        }
    }
    if(count==26)
    {
        printf("The String is a Pangram String.");
    }
    else
    {
        printf("The String is not a Pangram String.");
    }
    getch();
}
Posted by: Guest on July-01-2021

Browse Popular Code Answers by Language