diff --git a/Equal Sum and XOR b/Equal Sum and XOR new file mode 100644 index 0000000..9006b01 --- /dev/null +++ b/Equal Sum and XOR @@ -0,0 +1,30 @@ +// { Driver Code Starts +#include + + +int countValues (int n); +int main() +{ + int t; + scanf("%d",&t); + while(t--) + { + int n; + scanf("%d",&n); + + printf("%d\n",countValues(n)); + } +}// } Driver Code Ends + + +/*You are required to complete this method */ +int countValues (int n) +{ + //Your code here + int k=0; + for(int i=0;i<=n;i++){ + if((n+i)==(n^i)){k++;} + } + return k; +} +