Linux C Program (FIVE)

Source: Internet
Author: User

Example
1. Operators:

1#include <stdio.h>2 intMain () {3     intA, B, C, D;4A =Ten;5b = a++;//assign a value to B,a and then self-increment6c = ++a;//Add and then assign a value to C7D =Ten*a++;//equivalent to d= (10*a), a=a+18printf"b,c,d:%d,%d,%d", b,c,d);9 }Ten Output: Oneb, C, DTen, A, -

2. Two ways to exchange values for two variables

1Method: Intermediate variable2     intA=1, b=2, temp;3temp =A;4A =b;5b =temp;6 Method Two:7   intA=1, b=2;8A = a +b;9b = A-b;TenA = a-B;

Linux C Program (FIVE)

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.