in this example i tried to concatenate "same" with "is the best player in his team" using scanf("%[^\n]s",string)
to allow scaf
to detect the spaces but it didn't work in this code as i have scanf
before it and the compiler considers the "enter" after the first entry of the first scanf
and it doesn't even go throw this line scanf("%[^\n]s",string)
i can't find alternative to make the compiler consider the spaces in this case.
#include <stdio.h>
int main() {
int i = 4,x;
double d = 4.0,y;
char s[] = "sam ",string[50];
scanf("%d",&x);
scanf("%lf",&y);
scanf("%[^\n]s",string);
printf("%d\n",(i+x));
printf("%.1lf\n",(d+y));
printf("%s%s",s,string);
}