/************************************/
/* practice 2 第三章作业 */
/***********************************/
void p3_2()
{
int num1;
printf("Please input an ASCII :");
scanf("%d",&num1);
printf("the value of ASCII is:%d\n",num1);
printf("the character :%c",(char)num1);
}
/************************************/
/* practice 3 第三章作业 */
/***********************************/
void p3_3()
{
printf("\a");
printf("Start by the sudden sound, Sally shoted,\n\"By the Great Pumpkin, what was that!\"");
}
/************************************/
/* practice 4 第三章作业 */
/***********************************/
void p3_4()
{
float num1;
printf("Please Enter a floating-point value:");
scanf("%f",&num1);
printf("fixed-point notation: %f\n",num1);
printf("exponential notation: %e\n",num1);
printf("p notation: %a\n",num1);
}
/************************************/
/* practice 5 第三章作业 */
/***********************************/
void p3_5()
{
float s = 3.156e7;
int age;
float s2;
printf("Please Enter your age:");
scanf("%d",&age);
s2 = (float)age * s;
printf("\nYour age is %d\n",age);
printf("you have been speed %.0f second",s2);
}
/************************************/
/* practice 6 第三章作业 */
/***********************************/
void p3_6()
{
float waterM = 3.0e-23;
int num;
float water=0;
printf("请输入水夸数:");
scanf("%d",&num);
water = ((float)num*950)*waterM;
printf("%f",waterM);
}
/************************************/
/* practice 7 第三章作业 */
/***********************************/
void p3_7()
{
double height,result;
printf("Please Enter your height:");
scanf("%lf",&height);
result = height * 2.54;
printf("your height is %lf cm\n",result);
}
int main()
{
p3_7();
return 0;
}