Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Some simple basic questions about c language.
Some simple basic questions about c language.
& lt<<<<<<< >>>>>>>>>>>>>

The topic is not very detailed.

I can only give a rough answer,

1. floating-point number has two representations: (1) decimal decimal form, such as 0. 123(2) exponential form, such as 123e3.

Please note that the letter E or E must be preceded by a number, and the exponent after E must be an integer. In the title, A is obviously wrong, and in B, (1)-0.60 is also wrong.

2 integer values such as 12, 0,-3; The real value is 4.6,-1.23; Different types of quantities can participate in operations and assign values to each other. Among them, the type conversion is automatically completed by the compilation system. Real constants are also called real numbers or floating-point numbers. When an integer value is input for a real variable, the compiler system automatically completes the type conversion between them.

3. The topic is unclear. It is estimated that m = n * 100+0.5, and n = 0/ 100.0 is a relation in the function, depending on the function.

4.main ()/* main function */

{ float x; /* Variable Description */

scanf("%f\n ",& ampx); /* Enter x, y values */

Is the external input of x X=4.5.

printf("X=%5.2f\n ",X);

printf(" ceil(% 3. 1f)= % 4.2f \ n ",x,ceil(x));

printf("ldexp(%3. 1f,4)=%4.2f\n ",x,ldexp(x,4));

printf("pow(%3. 1f,3.2)=%4.2f\n ",x,pow(x,3.2)); /* Call the maximum function */+/* Output */

}

The running results of the program are as follows:

X=4.50

Upper limit =(4.5)=5.00

ldexp(4.5,4)=72.00

pow(4.5,3.2)= 123. 1 1

The value of (1)x is 4.5, externally input;

(2) What does the decimal before f mean? "%4.2f" specifies an output width of 4 and an accuracy of 2. When the actual length exceeds 4, it should be output according to the actual number of digits, and the part with decimal digits exceeding 2 is truncated;

(3)ldexp stands for calling the ldexp(x, 4) function, and scanf and printf are input and output functions.

If you don't understand, contact as soon as possible.