Team Emertxe
Pre-Processing
Assignment 2
Assignment 2
Assignment 2
WAP to define a macro swap(t,x,y) that swaps 2 argument
of type t.
Assignment 2
WAP to define a macro swap(t,x,y) that swaps 2 argument
of type t.
Input:
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
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:
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
How will you swap 2 integer numbers?
Assignment 2
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
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).
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.
Sample execution:-
Assignment 2
Sample execution:-
Assignment 2
Sample execution:-
Assignment 2
Assignment 2
Pre-requisites:-
Assignment 2
Pre-requisites:-
⮚ Macros
Assignment 2
Pre-requisites:-
⮚ Macros
Objective:-
Assignment 2
Pre-requisites:-
⮚ Macros
Objective:-
⮚ To understand the concepts of Macros in preprocessing
Team Emertxe
Thank you

02_swap.pdf