Question: A 5 6 - WAP to define a macro swap ( t , x , y ) that swaps 2 arguments of type t Due

A56- WAP to define a macro swap (t, x, y) that swaps 2 arguments of type t
Due date: Monday, 1 July 2024,11:59 PM
Requested files: swap.c ( Download)
Type of work: Individual work
Description:
Implement swap concept with the help of macro
The type of arguments to swap will be passed as t
swap (int, x, y) where x and y are of types int.
Pr-requisites:-
Macros
Objective: -
To understand the concept of
Macros in preprocessing
Note:- You don't have to evaluate this assignment. Just submit it. For your reference, you can run the code
Inputs: -
Integers N1 and N2
Sample execution: -
Test Case 1:
user@emertxe]./swap
1. Int
2. char
3. short
4. float
5. double
6. string
Enter you choice : 1
Enter the num1 : 10
Enter the num2 : 20
After Swapping :
num1 : 20
num2 : 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!