C语言,帮看下程序有什么问题
/*课上作业*/
#include<stdio.h>
#include<math.h>
main()
{
float a,b,c,d,x1,x2;
a=3.2;
b=2.1;
c=-8.4;
d=b*b-4*a*c;
x1=(-b+sqrt(p))/(2*a);
x2=(-b-sqrt(p))/(2*a);
printf("x1=%f,x2=%f",x1,x2);
return 0;
}
错在哪里啊
--------------------Configuration: q - Win32 Debug--------------------
Compiling...
q1.c
D:\VC\VC\Microsoft Visual Studio\MyProjects\q\q1.c(7) : warning C4305: '=' : truncation from 'const double ' to 'float '
D:\VC\VC\Microsoft Visual Studio\MyProjects\q\q1.c(8) : warning C4305: '=' : truncation from 'const double ' to 'float '
D:\VC\VC\Microsoft Visual Studio\MyProjects\q\q1.c(9) : warning C4305: '=' : truncation from 'const double ' to 'float '
D:\VC\VC\Microsoft Visual Studio\MyProjects\q\q1.c(11) : error C2065: 'p' : undeclared identifier
D:\VC\VC\Microsoft Visual Studio\MyProjects\q\q1.c(11) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data
D:\VC\VC\Microsoft Visual Studio\MyProjects\q\q1.c(12) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data
Error executing cl.exe.
q1.obj - 1 error(s), 5 warning(s)