Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started