Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a macro and a program for swapping the contents of two variables. The macro should have three parameters: the two variables and the

 

Write a macro and a program for swapping the contents of two variables. The macro should have three parameters: the two variables and the corresponding data type. Your program should read two integers and two floats from the standard input. Then you should print on the standard output the contents of the four variables after swapping (floats with a floating point precision of 6). You can assume that the input will be valid. Your solution has to satisfy the requirements from the problem description and has to pass the following testcase and potentially other testcases which are uploaded. All characters are relevant for passing testcases including newlines and spaces. Testcase 6.1: input Testcase 6.1: output 1 2 3.45 5.677 After swapping: 2 1 5.677000 3.450000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Elements Of Chemical Reaction Engineering

Authors: H. Fogler

6th Edition

013548622X, 978-0135486221

More Books

Students also viewed these Programming questions

Question

Question 2 For an n x n matrix A = form) via (aij)

Answered: 1 week ago