Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * File: main.c
- * Author: Gerardo Cicalese
- *
- * Created on 16 settembre 2019, 15.48
- */
- #include <stdio.h>
- #include <stdlib.h>
- #define TRUE 1
- #define FALSE 0
- int check_greater_vex(int * vex, int n, int a){
- if(n==1)
- if(*vex>a)
- return TRUE;
- else
- return FALSE;
- else if(n<1)
- return -1;
- else
- if(*vex>a && TRUE==check_greater_vex(vex+1, n-1, a))
- return TRUE;
- else
- return FALSE;
- }
- int main(void){
- int elem, vex[]={63, 15, 42, 63, 92, 34, 77, 23, 78, 37, 26, 7, 79, 85, 82, 19, 89, 10, 64};
- size_t len=sizeof(vex)/sizeof(vex[0]);
- scanf("%d", &elem);
- printf("Condition is %s\n", (TRUE==check_greater_vex(vex, len, elem))?("verified"):("not verified") );
- return 0;
- }
Add Comment
Please, Sign In to add comment