Panagrams in C.

/*Here in this problem a sentence took input as a single string needs to be checked whether it's containing all alphabets(Capital or small) or not if it contains all alphabets it is a Panagram if not Not a pangram.*/

"Click here to see the problem"

#include <stdio.h>

int main()

{

               char str[1000],a;

               int i,flag;

               scanf("%[^\n]",str);

               for(a='a'; a <= 'z';a++)

               {

                flag=0;

                for(i=0;str[i]!='\0';i++)

                {

                if(str[i]==a || str[i]==a-32)

                 {

                   flag=1;

                   break;

                 }

                }

                 if(flag == 0) 

                  break;

               }

               if(flag == 0)

               printf("not pangram");

               else

               printf("pangram");

    return 0;

}


//post your doubts in the comment box.

Comments

Post a Comment