You cannot specifiy width or precision values on numbers that are to be read. The
scanf
function will attempt to read all valid characters (digits and decimal point) that make up a number, and convert it to the appropriate type. So change your
scanf
line to:
scanf("%f %f",&num1, &num2);