Yes it is possible in addition to above answer , here is an example to understand more.
int main()
{
int x = 0;
char y[20] = "";
printf("Enter an integer : ");
scanf("%3d", &x); //Note it will only take the first 3 digit and store it into x
printf("number provided by you : %d\n", x);
printf("Enter a string: ");
scanf("%15s", y); // Note only take maxof 15 character and store it into y
printf("String provided by you : %s\n", y);
return 0;
}
OutPut:
Enter an integer : 12345
number provided by you : 123 // as it only takes the first 3 digit because we use "%3d"
Enter a sting : HelloWorldHelloWorld
String provided by you : HelloWorldHello //only prints the fisrt 15 char.