Playing With Characters

Sort by

recency

|

871 Discussions

|

  • + 0 comments

    here is my approach:

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

  • + 0 comments

    Here is HackerRank Playing with Characters solution in C

  • + 0 comments
    #include <stdio.h>
    #include <string.h>
    #include <math.h>
    #include <stdlib.h>
    
    int main() 
    {
        char ch,s[100],sen[100];
        scanf("%c\n%s\n%[^\n]s",&ch,s,sen);
        printf("%c\n%s\n%s",ch,s,sen);
        return 0;
    }
    
  • + 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