4. Assignment 2
WAP to define a macro swap(t,x,y) that swaps 2 argument
of type t.
5. Assignment 2
WAP to define a macro swap(t,x,y) that swaps 2 argument
of type t.
Input:
6. Assignment 2
WAP to define a macro swap(t,x,y) that swaps 2 argument
of type t.
Input: Read choice of date type t from user and read 2 values
of type t
7. Assignment 2
WAP to define a macro swap(t,x,y) that swaps 2 argument
of type t.
Input: Read choice of date type t from user and read 2 values
of type t
Output:
8. Assignment 2
WAP to define a macro swap(t,x,y) that swaps 2 argument
of type t.
Input: Read choice of date type t from user and read 2 values
of type t
Output: Swap 2 values of type t and display the values
9. How will you swap 2 integer numbers?
Assignment 2
10. How will you swap 2 integer numbers?
Input: num1 = 10 and num2 = 25
Output: num1 = 25 and num2 = 10
Assignment 2
10
num1 25
num2
num1 25
num2
10
num1 25
num2
25
num1 num2
10
temp
10
10
11. Assignment 2
It will work only for 2 integer arguments, so how will
you swap 2 arguments of type t? (t means it can be int,
char, short, float, string or double).
12. Assignment 2
It will work only for 2 integer arguments, so how will
you swap 2 arguments of type t? (t means it can be int,
char, short, float, string or double).
Use MACROS.
Write a Multiline MACRO to swap 2 arguments of type t.