Sort by

recency

|

1158 Discussions

|

  • + 0 comments
    void update(int *a,int *b) {
        int temp = *a; // copy the value of a 
        *a = *a + *b; 
        *b = abs(temp - *b);      
    }
    int main() {
        int a, b;
        int *pa = &a, *pb = &b;
        
        scanf("%d %d", &a, &b);
        update(pa, pb);
        printf("%d\n%d", a, b);
    
        return 0;
    }
    
  • + 0 comments

    Here is Pointers in c++ solution - https://programmingoneonone.com/hackerrank-pointer-solution-in-cpp.html

  • + 0 comments
    #include <stdio.h>
    #include<iostream>
    
    void update(int *a,int *b) {
            int temp= *a + *b;
            *b=abs(*a - *b);
            *a=temp;
    }
    
  • + 0 comments
    void update(int* a, int* b);
    
    int main() {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT */   
        int a,b;
        std::cin >> a >> b;
        update(&a, &b);
        std::cout << a << std::endl;
        std::cout << b << std::endl;
        return 0;
    }
    
    void update(int* a, int* b)
    {
        int tempA = *a;
        int tempB = *b;
        
        *a = tempA+tempB;
        *b = abs(tempA - tempB);
    }
    
  • + 0 comments

    I want to start my own automated design like hacking and penetration Cpp. I will tell you about hacking languages and I want to learn it with Shahd Fpp, which is my design.