Posts

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)                  { ...

Camel case in hackerRank (IN C)

problem link /*In this problem Every word is started with a capital letter(Except the First word) and no space is given. so there is a word where a capital letter is found. So no of words is equal to no of capital letters +1(we need to include the first word which doesn't contain capital letters.*/  #include<stdio.h> #include<string.h> #define max 100001 //giving the constant value for no of characters in a string, int main() {     char str[max];     int i,count=0,j;     scanf("%s",&str);     for(j=0;j<strlen(str);j++)     {     for(i=65;i<=90;i++)    // ascii value of  'A'=65 , 'Z'=90     {         if(str[j]==i)           {             count=count+1;         }     }     }     printf("%d",count+1);     return 0; } //post your doubts in com...