53. Double Pointer

Back To All Submissions
Previous Submission
Next Submission

Code

#include<stdio.h>
void check(int **pp,int *n2){
    if(**pp % 2 ==0){
        *pp = n2;
    }
}
int main(){
    int n1,n2;
    scanf("%d %d",&n1,&n2);
    int *p=&n1;
    check(&p,&n2);
    printf("%d",*p);
    return 0;

}

Solving Approach

 

 

 

Was this helpful?
Upvote
Downvote