Wednesday, October 24, 2012

Operator with C

Dear Dosen

Nama: Deab Sina
Utama: D4 TMD ITB Batch 6

Ini video saya tentang Operator. Dalam video ini memiliki 10 latihan.
1. (3*i-2*j)%(2*j-4)
2. 2*((i/5)+(4*(j-3))%(i+j-2))

3. -(i + j )
4. ++i
5. i++
6. --j
7. ++x
8. y--

9. i <= j
10. x >= 0 .


I. Operator

         1. Arithmetic operators

          + addition
        - subtraction
        * multiplication
        / division
        % modulus (remainder)

         2. Comparison operators/relational operators

                        ==            Equal to
                        !=              Not equal to
                        >              Greater than
                        <               Less than
                        >=             Greater than or equal to
                        <=             Less than or equal to 

         3. Logical operators

                         !               Logical negation (NOT)
                         &&          Logical (AND)
                         ||               Logical (OR)

         4. Assignment operators

                         +=             Addition assignment
                         -=              Subtraction assignment
                         *=              Multiplication assignment
                          /=              Division assignment
                         %=             Modulo assignment 
      

         5. Unary operators

                  Incremental Operator

                                ++k : It's mean that it will increment(+1) first, then show the result
                                                  int k = 10;
                                                  printf("k = %d\n", k); //k = 10
                                                  printf ("k = %d\n", ++k); //k = 11
                                                  printf("k = %d\n", k); //k = 11

                                k++: It's mean that it show the result first, then it increment
                                                  int k = 10;
                                                  printf("k = %d\n", k); //k = 10
                                                  printf ("k = %d\n", k++); //k = 10
                                                  printf("k = %d\n", k); //k = 11

                 Decremental Operator

                                --k : It's mean that it will decrement(-1) first, then show the result
                                                  int k = 10;
                                                  printf("k = %d\n", k); //k = 10
                                                  printf ("k = %d\n", --k); //k = 9
                                                  printf("k = %d\n", k); //k = 9

                                k--: It's mean that it show the result first, then it decrement
                                                  int k = 10;
                                                  printf("k = %d\n", k); //k = 10
                                                  printf ("k = %d\n", k--); //k = 10
                                                  printf("k = %d\n", k); //k =9


                   

Ini adalah link saya ke video: http://youtu.be/4miSUk5q7w8


Terimakasih,

No comments:

Post a Comment