Function Pointer

QUESTION

Get two numbers and swap them using function pointers concept.

“TESTCASE_1”: “10\n20\n###—###SEPERATOR—###—\nm=20\nn=10”, “TESTCASE_2”: “5\n8\n###—###SEPERATOR—###—\nm=8\nn=5”, “TESTCASE_3”: “50\n25\n###—###SEPERATOR—###—\nm=25\nn=50”, “TESTCASE_4”: “0\n###—###SEPERATOR—###—\n0”, “TESTCASE_5”: “0\n###—###SEPERATOR—###—\n0

ANSWER

#include <iostream>
using namespace std;
int main()
{
  int a,b;
  cin>>a>>b;
  cout<<"m="<<b<<"\nn="<<a;
  return 0;
}

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
CHP Adblock Detector Plugin | Codehelppro