"C language Learning" C Primer Plus 5th operators, expressions, and statements

Source: Internet
Author: User
Tags arithmetic operators

Learning Summary

1, with a certain language basis, operators and expressions These are very similar, there is no difference between the assignment operator (=), arithmetic operators (+ 、-、 *,/,%, + + 、——) and other operators (sizeof, (type)).

2, declare a parameter to create a called formal parameter (formal argument) or formal parameters (formal parameter). We call a function call passing a value called the actual parameter (actual argument) or the actual argument (actual parameter).

3, Programming exercises (Title 8):

1#include <stdio.h>2 voidTemperatures (DoubleFahrenheit);3 Const Doublec1=1.8l;4 Const DoubleC2= +.0l;5 Const Doublec3=273.16l;6 intMain () {7         DoubleFrh;8          while(1){9printf"Please enter Fahrenheit:");Tenscanf"%LF",&FRH); One                 if(frh==0){ A                          Break; -                 } - temperatures (FRH); theFrh=0; -         } -printf"over!\n"); -         return 0; + } -  + voidTemperatures (Doublef) { Aprintf"fahrenheit=%.2f\n", f); atprintf"celsius=%.2f\n", c1*f+C2); -printf"kelvin=%.2f\n", c1*f+c2+C3); -}

Operation Result:

Please enter FAHRENHEIT:12

fahrenheit=12.00

celsius=53.60

kelvin=326.76

Please enter FAHRENHEIT:Q

over!

"C language Learning" C Primer Plus 5th operators, expressions, and statements

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.