Example if user enters:
My name is James.
Using scanf, I have to print the full line, i.e. My name is James., then I have to get t
#include "stdio.h"
int main()
{
char str[20];
int i,t;
scanf("%d",&t);
while(t--){
fflush(stdin);
scanf(" %[^\t\n]s",str);// --scanf to accept multi-word string
i = strlen(str);// -- variable i to store length of entered string
printf("%s %d\n",str,i);// -- display the entered string and length of string
}
return 0;
}