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 :: C program to calculate the sum of odd and even numbers 
C :: c calling a function 
C :: sphinx-doc 
C :: Example of read and write project in c 
C :: files in c programming 
C :: use frama c online 
C :: deleting a word with copy fuction c code 
C :: c sjf 
C :: With which of the following can you run code without provisioning or managing servers and pay only for the compute time consumed (there is no charge when the code is not running)? 
C :: Print mark-sheet of students 
C :: C/c drop mime 
C :: string text line 
C :: Minimum Distance between words[AMAZON] 
C :: What does x = (a<b)? A:b mean in C programming? 
C :: reset c array to zero 
C :: arrow keys gaming keyboard 
C :: table de hachage en c 
C :: online c compiler for graphics 
C :: 157.245.33.77: 
C :: when to add & in snacf c 
C :: c++ convert to c online 
C :: under 
C :: python adding calculator 
C :: rainmaker simple project 
C :: online c compiler 
C :: function pointer in c 
C :: how to check where the last char is in a string c 
C :: unox reclame harmonica tabs 
Dart :: elevated button size flutter 
Dart :: flutter positioned center horizontally 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =