A complete C++ program with the output Develop a C++ application to implement floating point addition algorithm by assum
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
A complete C++ program with the output Develop a C++ application to implement floating point addition algorithm by assum
I need comments on the code and a screenshot of the codeand the output too Please !!!
A complete C++ program with the output Develop a C++ application to implement floating point addition algorithm by assuming positive numbers only, use the following pattern to start the code. #include <iostream> #include <string> int main() { // first input: 3.25 int A_sign = 0; int A exponent = 128; std::string A_fraction = "1.10100000000000000000000"; std::cout << "1st input: " 11 sign: << A_sign << 11 11 "1 exponent: << A_exponent << fraction " << A fraction << std::endl; // second input: 11.5 int B_sign = 0; int B_exponent = 130; std::string B_fraction = "1.01110000000000000000000"; std::cout << "2nd input: " "1 sign: " << B sign << 11 exponent: << B exponent << " fraction " << B fraction << std::endl; 11 // implement addition algorithm here // Print sign, exponent, and fraction of final result return 0; } Verify your implementation is correct by comparing against expected outputs: • Sign: 0• Exponent: 10000010 Fraction: 1.1101100000000000000000