Showing posts with label Pangrams hacker rank solution in C. Show all posts
Showing posts with label Pangrams hacker rank solution in C. Show all posts

Wednesday, 25 October 2017

Pangrams Hacker rank solution in C


 #include <stdio.h>
int main()
{
               char st[1000],alpha;
               int i,flag;
               scanf("%[^\n]",st);
               for(alpha='a'; alpha <= 'z';alpha++)
               {
                              flag=0;
                              for(i=0;st[i]!='\0';i++)
                              {
                                             if(st[i]== alpha || st[i]== alpha-32)//in entire string if ‘a’ is present
                                             {
                                                            flag=1;
                                                            break;
                                             }
                              }
                              if(flag == 0) //in entire string ‘a’ is not present
                                             break;
               }
               if(flag == 0)
                              printf("not pangram");
               else
                              printf("pangram");
    return 0;
}

Output: