Question: 5 . a ) The following program is used to swap the contents of two pointer variables of integer type, but the program has some
a The following program is used to swap the contents of two pointer variables of integer type, but the program has some errors. Correct the program to get the specified operation. Assume, if the values of a and b integer type pointer variables are and respectively before swapping, then the values of a and b are and respectively after swapping. #include #include int main int ab temp; aint mallocsizeofint; bint mallocsizeofint; scanfdd &a &b; printfd d
a b; tempa; ab; btemp; printfd d
a b; freea; freeb; return ; b Find output for the following program #include void changeint x; int main int a; printfd
a; change&a; printfd
a; return ; void changeint xxx; x; return; OR #include void func int B int n; int main int A; int i; fori; i; i printfd Ai; funcA; printf
; fori; i; i printfd Ai; return ; void func int B int n int i; fori; i
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
