PLEASE GIVE C++ CODE OF THE 2nd and 3rd
Question.
PLEASE CHECK YOUR CODE BEFORE POSTING IT
I WILL UPVOTE IF THE ANSWER IS CORRECT!
As per HOMEWORKLIB POLICY, I am answering only the first question. In order to get answers of more question please upload the remaining questions separately:
Below is the answer related to question 2.
Q2.) Below is the required C++ code:
#include<iostream>
using namespace std;
//#define multiply(x) x*x
//#define multiply(x) (x*x)
//#define multiply(x) (x)*(x)
#define multiply(x) ((x)*(x))
int main()
{
double ans = 20.0/multiply(2+3);
cout<<ans<<endl;
return 0;
}//end of main function
Note: run using 1 macro at a time, and check the result.
a.) 19
b.) 1.81818
c.) 20
d.) 0.8
Hope it helps, give it a thumbs up.
Feel free to comment in case of any query.
PLEASE GIVE C++ CODE OF THE 2nd and 3rd Question. PLEASE CHECK YOUR CODE BEFORE POSTING...
C programming lab: Description: In this lab you will write a program that will contain two functions, setlsbs() and getlsbs(). These functions will use bitwise operators to embed and extract "hidden" bits in a character array. Write a program to test your functions as follows: Obtain a random number seed from the command line of your program using command line arguments. Initialize an array p of 8 unsigned char with random numbers from 0 to 255 Initialize a separate unsigned...
This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation inside a class. Task One common limitation of programming languages is that the built-in types are limited to smaller finite ranges of storage. For instance, the built-in int type in C++ is 4 bytes in most systems today, allowing for about 4 billion different numbers. The regular int splits this range between positive and negative numbers, but even an unsigned int (assuming 4 bytes)...