(C syntax) Addition, c syntax Addition

Source: Internet
Author: User

(C syntax) Addition, c syntax Addition

Description:

Two integers in one row, with an output description within a long integer:

Example of an integer input in one row: if the question is not specifically described, read the data in multiple groups or refer to a001.

2000 9

Output example:

2009

# Include <stdio. h> int main () {int a, B; scanf ("% d", & a, & B); printf ("% d \ n ", a + B); return 0 ;}

 


Use a, B, c to represent rational numbers, write: 1, addition exchange law: 2, addition combination law:

Addition exchange law: a + B = B +

Addition Law: a + (B + c) = (a + B) + c

[Not clear. Ask again. If you are satisfied, please adopt it! Wish you good luck ☆ !!]]

Write programs separately to verify the syntax of the following C language: a. Different prefix and suffix operations of auto-increment and auto-subtraction operations B. remainder operations can only be applied

I. Use assertions to verify the difference between the prefix and suffix of the auto-increment and auto-Subtract operators:

# Include <stdio. h>
# Include <assert. h>

Int main ()
{
Int;

A = 5;
Assert (++ a = 6 );

A = 5;
Assert (a ++ = 5 );
Assert (a = 6 );

A = 5;
Assert (-- a = 4 );

A = 5;
Assert (a -- = 5 );
Assert (a = 4 );
}

Ii. Incomplete questions about Remainder

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.