how to take space separated input in c code example
Example 1: how to read space separated words in c
scanf("%[^\n]%*c", ref_string);
Example 2: how to take comma separated integer input in c
scanf("%d,",&arr[i]);
scanf("%[^\n]%*c", ref_string);
scanf("%d,",&arr[i]);