Increment a number without using ++ or + | CPP program to increment an unsigned char using bitwise operators . ; function that increment the value . ; Invert bits and apply negative sign ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; char increment ( unsigned char i ) { i = - ( ~ i ) ; return i ; } int main ( ) { char n = ' a ' ; cout << increment ( n ) ; return 0 ; }