I have the following code:
#include <stdio.h>
float a; //Initialize variables
char b;
int c;
char d;
int main(void)
{
printf("Enter float: ");
scanf("%4.2f", &a);
printf("%4.2f", a);
//printf("Enter character:\n");
//printf("Enter 4-digit integer: \n");
//printf("Enter character:\n");
return 0;
}
However I get the following errors when compiling:
1.)
scanf
:unknown field type character '.' in format specifier2.)
scanf
: too many arguments passed for format string
Can anyone explain what the issue in my code is?
Thank you!