// Pantea Aria // pointers // Write a program that: // Reads two integers from the user. // Passes their addresses to a function called add. // The function should add the values and return the result; // Print the result #include int add(int *p, int *q); int main() { // Reads two integers from the user. printf ("Enter two integers:"); int num1, num2; scanf("%d %d", &num1, &num2); // Passes their addresses to a function called add. // add the values and return the result int result = add(&num1, &num2); // Print the result printf("Result is %d\n", result); return 0; } // function definition/body int add(int *p, int *q) { int r = *p + *q; return r; }