Monday, April 13, 2020

Increment and decrement operators in C


  • Program :
#include <stdio.h>
#include<conio.h>
void main()
{
    int a,b;
    clrscr();
    printf("\n----------------INCREMENT AND DECREMENT OPERATORS----------------");
    printf("\nEnter any two values:");
    scanf("%d%d",&a,&b);
    printf("\n----------------INCREMENT OPERATOR(++)----------------");
    printf("\n Increment is : %d",++a);
    printf("\n----------------DECREMENT OPERATOR(--)----------------");
    printf("\n Decrement is : %d",--b);
    getch();
}

  • Output :




No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...