• + 20 comments

    for security purpose gets function not used by company beczuse of buffer so you have to use scanf function but still there is some problem occurig here in scanf function while taking input through scanf,You have just give one space like " %[^\n]s".I don't know what is the reason.I am giving my submission code

    int i = 4;
        double d = 4.0;
        char s[] = "HackerRank ";
        int x;
        double y;
        char name[100];
        scanf("%d",&x);
        scanf("%lf",&y);
        scanf(" %[^\n]s",name);
        printf("%d\n",(i+x));
        printf("%.1lf\n",(y+d));
        printf("%s",s);
        printf("%s",name);
        return 0;