diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..b1f5b7c --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,28 @@ +{ + "tasks": [ + { + "type": "cppbuild", + "label": "C/C++: g++.exe build active file", + "command": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\g++.exe", + "args": [ + "-fdiagnostics-color=always", + "-g", + "${file}", + "-o", + "${fileDirname}\\${fileBasenameNoExtension}.exe" + ], + "options": { + "cwd": "${fileDirname}" + }, + "problemMatcher": [ + "$gcc" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "detail": "Task generated by Debugger." + } + ], + "version": "2.0.0" +} \ No newline at end of file diff --git a/Bit manipulation/find odd occuring elements in the array.cpp b/Bit manipulation/find odd occuring elements in the array.cpp new file mode 100644 index 0000000..45e745d --- /dev/null +++ b/Bit manipulation/find odd occuring elements in the array.cpp @@ -0,0 +1,23 @@ +// Find the elements whoch are odd occuring in the array +#include +using namespace std; +int findOdd(int arr1[], int n1) +{ + int result = 0; + + for(int i = 0; i < n1; i++) + { + result = result ^ arr1[i]; + } + + return result; +} + +int main() { + + int arr1[]= {1, 5, 4, 6, 6, 5, 2, 2, 3}, n1 = 9; + + cout<