diff --git a/Array/Missing Number/C/solution.c b/Array/Missing Number/C/solution.c new file mode 100644 index 0000000..97effa5 --- /dev/null +++ b/Array/Missing Number/C/solution.c @@ -0,0 +1,19 @@ +#include + +void main() +{ + int n, i, j, c, t, b; + printf("n= "); + scanf("%d", &n); + int array[n - 1]; + printf("nums= "); + for (i = 0; i < n - 1; i++) + scanf("%d", &array[i]); + b = array[0]; + for (i = 1; i < n - 1; i++) + b = b ^ array[i]; + for (i = 2, c = 1; i <= n; i++) + c = c ^ i; + c = c ^ b; + printf("%d \n", c); +} diff --git a/Contributors.md b/Contributors.md index c711a66..9436bc5 100644 --- a/Contributors.md +++ b/Contributors.md @@ -30,4 +30,4 @@ Welcome to the list of people who contributed to this repo 💥 13. [Saransh](https://github.com/saranshkotnala) 14. [Eldrin](https://github.com/eldrin0)(Added Bubble Sort solution in JS) 15. [amankumar988](https://github.com/amankumar988)(Solved Issues #18, #16, #20) -16. [kesher988](https://github.com/kesher988)(solved issue #9,#24,#54,#29) +16. [kesher988](https://github.com/kesher988)(solved issue #9,#24,#54,#29,#21)