Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int rec_func(double*/*can be called also as double a[]*/, int, double); //decletion
- int main()
- {
- double arr[7] = { 2,5,8,9.3,11.5,17.4,20.5 };
- double a = 25.4;
- int b = rec_func(arr, 7, a);
- printf("%d", b);
- }
- int rec_func(double* arr, int size, double num)
- {
- if (size <= 1)
- {
- return 0;
- }
- if (arr[size - 1] + arr[size] == num) // algorithm (WORNG) needed to check the docmation on LECTURS.
- {
- return 1;
- }
- rec_func(arr, size - 1, num);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement