1.
#include<stdio.h>
int main(void)
{
float a;
printf("Please intput a float:\n");
scanf("%f",&a);
printf("a.The intput ia %.1for%.1e\n",a,a);
printf("b.The intput ia %+.3for%.3E\n",a,a);
return 0;
}
2.
#include<stdio.h>
#include<float.h>
int main(void)
{
double a=1.0/3.0;
float b=1.0/3.0;
printf("double a=1.0/3.0:\n");
printf("%.4e\n",a);
printf("%.12e\n",a);
printf("%.16e\n\n",a);
printf("float b=1.0/3.0:\n");
printf("%.4f\n",b);
printf("%.12f\n",b);
printf("%.16f\n\n",b);
printf("FLT_DIG:%d\n",FLT_DIG);
printf("DBL_DIG:%d\n",DBL_DIG);
return 0;
}