how to check odd no. in c++ using logical and
C++
#include <iostream>
using namespace std;
bool isEven(int n)
{
return (!(n & 1));
}
int main()
{
int n = 101;
isEven(n) ? cout << "Even" : cout << "Odd";
return 0;
}
Also in C++:
- Title
- c++ declare char
- Category
- C++
- Title
- nth_element c++
- Category
- C++
- Title
- fast input output in c++
- Category
- C++
- Title
- exponenciacion binaria
- Category
- C++
- Title
- fmod c++
- Category
- C++
- Title
- c++ menu selection with arrow keys
- Category
- C++
- Title
- c++ string to vector int
- Category
- C++
- Title
- hashing in competitive programming
- Category
- C++
- Title
- get index of value c++
- Category
- C++
- Title
- delete memory c++
- Category
- C++
- Title
- coping 2d vector in cpp
- Category
- C++
- Title
- linkedlist implementation in c++
- Category
- C++
- Title
- c++ class constructor
- Category
- C++
- Title
- monotonic deque
- Category
- C++
- Title
- kruskal c++
- Category
- C++
- Title
- disjoint set code in c++
- Category
- C++
- Title
- how to declare a vector in c++
- Category
- C++
- Title
- runtime array size c++
- Category
- C++
- Title
- c++ how to make a negative float positive
- Category
- C++
- Title
- correct sequence of compilation process in c++
- Category
- C++
- Title
- cube mapping sdl
- Category
- C++
- Title
- how to get input from the console in c++
- Category
- C++
- Title
- c++ map find
- Category
- C++
- Title
- c++ crash windows
- Category
- C++
- Title
- vector concat c++
- Category
- C++
- Title
- c++ empty stream
- Category
- C++
- Title
- c++ round to int
- Category
- C++
- Title
- iterative inorder traversal
- Category
- C++
- Title
- log base 10 c+_+
- Category
- C++
- Title
- c++ course
- Category
- C++
- Title
- shortest path with bfs in c++
- Category
- C++
- Title
- dfenwick tree code c++
- Category
- C++
- Title
- how to turn int into string c++
- Category
- C++
- Title
- hashmap in c++
- Category
- C++
- Title
- find_if c++ example
- Category
- C++
- Title
- assegnare valori in c++
- Category
- C++
- Title
- c++ do while loop
- Category
- C++
- Title
- how to concatinate two strings in c++
- Category
- C++
- Title
- first prime numbers less than
- Category
- C++
- Title
- how to take input in C++ in coding
- Category
- C++
- Title
- cpp create lambda with recursion
- Category
- C++
- Title
- range based for loop c++ with reference
- Category
- C++
- Title
- get data from terminal c++
- Category
- C++
- Title
- euler's totient function c++
- Category
- C++
- Title
- heap in cpp stl
- Category
- C++
- Title
- new keyword in cpp
- Category
- C++
- Title
- c++ give options string
- Category
- C++
- Title
- solve linear equations geeksforgeeks
- Category
- C++
- Title
- making random numbers in c++
- Category
- C++
- Title
- c++ for loop
- Category
- C++
- Title
- string length c++
- Category
- C++
- Title
- dfs in c++
- Category
- C++
- Title
- compare string c++
- Category
- C++
- Title
- how to iterate through array in c++
- Category
- C++
- Title
- convert int to binary string c++
- Category
- C++
- Title
- basic cpp programs
- Category
- C++
- Title
- what is difference between ciel and floor
- Category
- C++
- Title
- cpp loop through object
- Category
- C++
- Title
- range based for loop c++
- Category
- C++
- Title
- modular exponentiation c++
- Category
- C++
- Title
- std string find character c++
- Category
- C++
- Title
- c++ replace n substrings
- Category
- C++
- Title
- c++ random numbers
- Category
- C++
- Title
- can we compare a long long int with int in c++ using max or min functions
- Category
- C++
- Title
- string to number in c++
- Category
- C++
- Title
- Combination Sum
- Category
- C++
- Title
- sum of two numbers c++
- Category
- C++
- Title
- templates of templates c++
- Category
- C++
- Title
- access last element in vector in c++
- Category
- C++
- Title
- int to float c++
- Category
- C++
- Title
- pop_back
- Category
- C++
- Title
- array syntax in c++
- Category
- C++
- Title
- ue4 c++ overlapping functions cpp setup
- Category
- C++
- Title
- pass ss tream as parameter c++
- Category
- C++
- Title
- hohw toparse a string in c++
- Category
- C++
- Title
- length of array in cpp
- Category
- C++
- Title
- can you use a return to print a string when referencing an integer c++
- Category
- C++
- Title
- c++ char print width
- Category
- C++
- Title
- remove element by index from vector c++
- Category
- C++
- Title
- lambda c++
- Category
- C++
- Title
- Html tabulation
- Category
- C++
- Title
- maximum possible number atmost k swaps
- Category
- C++
- Title
- deque c++
- Category
- C++
- Title
- c++ vector lower_bound index
- Category
- C++
- Title
- convert entire string to lowercase c++
- Category
- C++
- Title
- c++ base 10 to base 2
- Category
- C++
- Title
- howt o initialize 3d vector in c++
- Category
- C++
- Title
- filling 2d array with 0 c++
- Category
- C++
- Title
- how to use assrt c++
- Category
- C++
- Title
- git branch in my bash prompt
- Category
- C++
- Title
- queue stl c++
- Category
- C++
- Title
- registering a new QML type
- Category
- C++
- Title
- cpp nan value
- Category
- C++
- Title
- for each c++
- Category
- C++
- Title
- c++ give options
- Category
- C++
- Title
- static_cast c++
- Category
- C++
- Title
- how to reverse a vector
- Category
- C++
- Title
- two elements with difference K in c++
- Category
- C++
- Title
- c++ iterate through constant list
- Category
- C++
- Title
- creare array con c++
- Category
- C++