To see a computer system from A+B (1)

Source: Internet
Author: User

Simple things come up and there will always be unexpected discoveries, and today we're going to talk about computing the addition of two numbers with a computer:

C language Just get started, will write this program (in order to focus on and a+b, here just show this function):

1 int  Add (int A,int  b)2{3     return a +b; 4 }

After a period of time to see this program, feel the original did not consider the decimal, so, simply a change, the program has become this:

1 double Add (double A,double  b)2{3      return A +b; 4 }

Such programs can solve many problems, but there is no universality: You can use him to calculate 1+2, 5+ (-12);

To see a computer system from A+B (1)

Related Article

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.