c primer plus 第三章

//第一题 
#include<stdio.h>
int main()
{
	int int_max = 2147483647 ;
	printf("%d %d\n",int_max,int_max+1);
	
	float float_max = 3.40e38;
	printf("%f %f",float_max,float_max+1);
	
	float float_min = 3.40e-38;
	printf("%f %f",float_min,float_min-1);
}
//第二题 
#include <stdio.h>
int main()
{
	printf("please enter a ASCII\n");
	int ASCII;
	scanf("%d",&ASCII);
	printf("%d ASCII is related to %c",ASCII,ASCII);
}
//第三题 
#include <stdio.h>
int main()
{
	printf("\a\n");
	printf("Startled by the sudden sound,Sally shouted,\n");
	printf("\"By the Great Pumpkin,what was that!\"");
	
}
//第四题 
#include <stdio.h>
int main()
{
	printf("Enter a floating-point value: ");
	float t;
	scanf("%f",&t);
	printf("fixed-point notation: %f\n",t);
	printf("exponential notation: %e\n",t);
	printf("p notation: %#a",t);
}
//第五题 
#include <stdio.h>
int main()
{
	printf("Enter your age");
	int age;
	scanf("%d",&age);
	printf("your age is corresponding %f seconds",age*3.156e7);
}
//第六题 
#include <stdio.h>
int main()
{
	printf("Please enter the quart of water:");
	int quart_water;
	scanf("%d",&quart_water);
	printf("%d quart of water have %f water molecules",quart_water,quart_water*950/3.0e-23);
}
//第七题 
#include <stdio.h>
int main()
{
	printf("Please enter your height in inch");
	int heigh;
	scanf("%d",&heigh);
	printf("your heigh in centimeters is %f",heigh*2.54);
}
//第八题 
#include <stdio.h>
int main()
{
	printf("Please enter the volume in cup:");
	int cup;
	scanf("%d",&cup);
	printf("the cups in pint is:%f\n",cup*0.5);
	printf("the cups in ounce is:%d\n",cup*8);
	printf("the cups in table_spoons is:%d\n",cup*8*2);
	printf("the cups in tea_spoons is:%d\n",cup*8*2*3);
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值