Here is my ans, If I have correctly understood your question. Pleas have a look.
#include <stdio.h>
int main()
{
float num = 0;
printf("Enter the number:\n");
scanf("%f", &num);
fprintf(stderr, "output (as suggested): %20.4f\n", num);
return 0;
}
Sample input output:
1.
Enter the number:
20.123
output (as suggested): 20.1230
2.
Enter the number:
133.123456
output (as suggested): 133.1234