We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. Prepare
  2. C++
  3. Introduction
  4. Pointer
  5. Discussions

Pointer

Problem
Submissions
Leaderboard
Discussions
Editorial

Sort 990 Discussions, By:

recency

Please Login in order to post a comment

  • nicoleliu1016
    1 week ago+ 0 comments
    #include <cmath>
    void update(int *a,int *b) {
        // Complete this function
        int c = *a;
        *a += *b;
        *b = abs(c - *b);
    }
    
    -1|
    Permalink
  • deepakkry_in
    2 weeks ago+ 0 comments

    void point(int *a,int *b) { int *c; *c=*a; *a=*a+*b; *b=abs(*c-*b); }

    -4|
    Permalink
  • gangadharghru67
    2 weeks ago+ 0 comments

    Here are the solution of Pointer in C++ Hacker Rank Solution

    0|
    Permalink
  • willyrifaldy9
    2 weeks ago+ 0 comments

    void update(int *a,int *b) { // Complete this function
    int x; int y; if(*a > *b){ x = (*a + *b); y = (*a - *b); *a = x; *b = y; } else { x = (*a + *b); y = *b - *a; *a = x; *b = y; }

    }

    0|
    Permalink
  • prathmeshbavge8
    2 weeks ago+ 0 comments

    include

    include

    void update(int *a,int *b) { // Complete this function
    int *c,*d; *c=*a; *a=*c + *b;
    *b = abs(*c - *b);

    }

    int main() { int a, b; int *pa = &a; int *pb = &b;

    scanf("%d %d", &a, &b);
    update(pa, pb);
    printf("%d\n%d", a, b);
    
    return 0;
    

    }

    0|
    Permalink
Load more conversations

Need Help?


View editorial
View top submissions
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy