Search
 
SCRIPT & CODE EXAMPLE
 

C

Increment & Decrement Operator in C language

int x;
int y;

x = 1;

y = ++x;      // value of x = 2, y = 2
y = x++;     // value of x = 3, y = 2

x = 3;

y = x--;      //value of x =2,y =3;
y = --x;      //value of x 1, y= 1;
Comment

C Increment and Decrement Operators

// Working of increment and decrement operators
#include <stdio.h>
int main()
{
    int a = 10, b = 100;
    float c = 10.5, d = 100.5;

    printf("++a = %d 
", ++a);
    printf("--b = %d 
", --b);
    printf("++c = %f 
", ++c);
    printf("--d = %f 
", --d);

    return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: how we can strore a nested structure values in arrays 
C :: Integer Input/Output 
C :: C Nested if...else 
C :: Sum of upper & lower triangles elements 
C :: online code runner .c 
C :: lognormal distribution - matlab 
C :: nc,manc 
C :: Laravel installation on Linux 
C :: print hello world c 
C :: opération bit à bit c 
C :: user define 
C :: online c compiler with mpi 
C :: gsl matrix invert 
C :: change variable type in c 
C :: c check if file was created 
C :: C Increment and Decrement Operators 
C :: C Variable Byte Sizes 
Dart :: flutter listtile shape border 
Dart :: flutter statusbar height 
Dart :: flutter appbar text color 
Dart :: Keyboard Pushes Text Fields off screen flutter 
Dart :: scroll to top flutter 
Dart :: dart absolute value 
Dart :: flutter dropdown button remove underline 
Dart :: raisedbutton flutter 
Dart :: string to double fultter 
Dart :: dart check if object has property 
Dart :: set container height flutter 25% of screen 
Dart :: flutter get platform type 
Dart :: flutter iOS & Android chnage package name & app name 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =