//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));
*/
//--------------------------------------------------------------------------------
}
Test of scanf and printf
最新推荐文章于 2023-02-19 11:19:43 发布