Test of scanf and printf

//This is the process during the learning of C
// And I write several test samples to test the function of scanf and printf
#include <stdio.h>
#include<stdlib.h>
#define C "C Programming"
int main(void)
{
	/* 
   int a=15;
   float b=123.123456789;
   double c=12345678.1234567;
   char d='p';
   printf("a=%d\n", a);
   printf("a(%%d)=%d, a(%%5d)=%5d, a(%%o)=%o, a(%%x)=%x\n\n",a,a,a,a);//We just need to change the format of output, so we can change a decimal number into octal number
   printf("a=%f\n", b);
   printf("b(%%f)=%f, b(%%lf)=%lf, b(%%5.4lf)=%5.4lf, b(%%e)=%e\n\n",b,b,b,b);
   printf("c=%f\n", c);
   printf("c(%%lf)=%lf, c(%%f)=%f, c(%%8.4lf)=%8.4lf\n\n",c,c,c);
   printf("d=%c\n", d);
   printf("d(%%c)=%c, d(%%8c)=%8c\n",d,d);
   */

//------------------------------------------------------------------------------- 
	/* 
	int i=8;
    printf("The raw value: i=%d\n", i);
    //printf("++i=%d \n++i=%d \n--i=%d \n--i=%d\n",++i,++i,--i,--i); 
    printf("The raw value: i=%d\n", i);
    printf("++i=%d\n", ++i);
    printf("++i=%d\n", ++i);
    printf("--i=%d\n", --i);
    printf("--i=%d\n", --i);
    */
//------------------------------------------------------------------------------- 
	/*
	int i=8;
    printf("%d\n",i);
    printf("%5d~~~~~\n",i);
	printf("%-5d~~~~~\n",i);
	*/
//--------------------------------------------------------------------------------
	/* 
	const double pi=3.14159269398;
	printf("%13.9f!!!!!",pi);
    return 0;
    */ 
//-------------------------------------------------------------------------------- 
  	/*
	int a;
    long long b;
    float f;
    double d;
    char c;
    printf("\nint:%d\nlong:%d\nfloat:%d\ndouble:%d\nchar:%d\n",sizeof(a),sizeof(b),sizeof(f),sizeof(d),sizeof(c));
    */
//-------------------------------------------------------------------------------- 

}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值