Playing With Characters

Sort by

recency

|

868 Discussions

|

  • + 0 comments

    include

    include

    include

    include

    int main() {

    char ch, s[100], sen[100];
    scanf("%c", &ch);
    printf("%c\n", ch);
    
    scanf("\n");
    
    scanf("%[^\n]%*c", s);
    printf("%s\n", s);
    
    scanf("%[^\n]%*c", sen);
    printf("%s", sen);
    
    return 0;
    

    }

  • + 0 comments

    Here is HackerRank Playing with characters solution in c

  • + 0 comments

    include `

    > 
    > > #include <string.h>
    > > #include <math.h>
    > > #include <stdlib.h>
    > > 
    > > int main() 
    > > {
    > >     char ch;
    > >     char s[99];
    > >     char sen[99];
    > >     scanf("%c",&ch);
    > >     printf("%c\n",ch);
    > >     scanf("%s",&s);
    > >     printf("%s\n",s);
    > >     fgets(sen,50,stdin); 
    > > 	  printf("%s",sen);
    > >      
    > >     return 0;
    > > }
    > > 
    > > 
    > ```
    

    How is this supposed to be not correct??? Why in the world do we need to use their way only???

  • + 0 comments

    include `

    include

    include

    include

    int main() { char ch; char s[99]; char sen[99]; scanf("%c",&ch); printf("%c\n",ch); scanf("%s",&s); printf("%s\n",s); fgets(sen,50,stdin); printf("%s",sen);

    return 0;
    

    }

    ` How is this supposed to be not correct??? Why in the world do we need to use their way only???

  • + 0 comments

    include

    include

    include

    include

    int main() { char ch; char s[99]; char sen[99]; scanf("%c",&ch); printf("%c\n",ch); scanf("%s",&s); printf("%s\n",s); fgets(sen,50,stdin); printf("%s",sen);

    return 0;
    

    }

    How is this supposed to be not correct??? Why in the world do we need to use their way only???