#include <stdio.h>
int add_two_void_pointers(void *a, void *b) {
// Your logic here
return *(int *)a + *(int *)b; // typecast both a and b pointers
} // as int add both
int main() {
int x, y;
scanf("%d %d", &x, &y);
int result = add_two_void_pointers(&x, &y);
printf("%d", result);
return 0;
}
Solving Approach
int add_two_void_pointers(void *a, void *b) {
// Your logic here
return *(int *)a + *(int *)b; // typecast both a and b pointers
} // as int add both