1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jeka94
3 years ago
7

Create union floatingPoint with members float f, double d and long double x. Write a program that inputs values of type float, d

ouble and long double and stores the values in union variables of type union floatingPoint. Each union variable should be printed as a float, a double and a long double. Do the values always print correcly? Note The long double result will vary depending on the system (Windows, Linux, MAC) you use. So do not be concern if you are not getting the correct answer. Input must be same for all cases for comparison Enter data for type float:234.567 Breakdown of the element in the union float 234.567001 double 0.00000O long double 0.G0OO00 Breaklo n 1n heX float e000000O double 436a9127 long double 22fde0 Enter data for type double :234.567 Breakdown of the element in the union float -788598326743269380.00OGOO double 234.567000 long double 0.G00000 Breakolon 1n heX float 0 double dd2f1aa0 long double 22fde0 Enter data for type long double:
Computers and Technology
1 answer:
Kitty [74]3 years ago
5 0

Answer:

Here the code is given as follows,

#include <stdio.h>

#include <stdlib.h>

union floatingPoint {

float floatNum;

double doubleNum;

long double longDoubleNum;

};

int main() {

union floatingPoint f;

printf("Enter data for type float: ");

scanf("%f", &f.floatNum);

printf("\nfloat %f ", f.floatNum);

printf("\ndouble %f ", f.doubleNum);

printf("\nlong double %Lf ", f.longDoubleNum);

printf("\n\nBreakdown in Hex");

printf("\nfloat in hex %x ", f.floatNum);

printf("\ndouble in hex %x ", f.doubleNum);

printf("\nlong double in hex %Lx ", f.longDoubleNum);

printf("\n\nEnter data for type double: ");

scanf("%lf", &f.doubleNum);

printf("float %f ", f.floatNum);

printf("\ndouble %f ", f.doubleNum);

printf("\nlong double %Lf ", f.longDoubleNum);

printf("\n\nBreakdown in Hex");

printf("\nfloat in hex %x ", f.floatNum);

printf("\ndouble in hex %x ", f.doubleNum);

printf("\nlong double in hex %Lx ", f.longDoubleNum);

printf("\n\nEnter data for type long double: ");

scanf("%Lf", &f.longDoubleNum);

printf("float %f ", f.floatNum);

printf("\ndouble %f ", f.doubleNum);

printf("\nlong double %Lf ", f.longDoubleNum);

printf("\n\nBreakdown in Hex");

printf("\nfloat in hex %x ", f.floatNum);

printf("\ndouble in hex %x ", f.doubleNum);

printf("\nlong double in hex %Lx ", f.longDoubleNum);

return 0;

}

You might be interested in
provide(s) many scalability benefits by offering additional network and storage resources on demand and services like autoscalin
Salsk061 [2.6K]

Answer:

The answer is cloud services.

Explanation:

The other answer choices just don't make sense. Python is a coding language and has nothing to do with scalability. Benchmarking has to do with finding out how powerful your system is. Denial of Service is when a website doesn't allow you to access it due to their servers being down.

6 0
3 years ago
BJP4 Self-Check 7.21: swapPairs<br><br> plsssss
Vedmedyk [2.9K]

Answer:

needs more expiation

Explanation:

add a worksheet to the question

6 0
3 years ago
What unit is used for measure disk size ?
Inessa [10]
Inches are the unit of measurements on a disk
8 0
4 years ago
Can someone pls answer this question within 30 min<br> Will give extra points
mixas84 [53]
Sure i don’t see an image though?
3 0
3 years ago
You are asked to transfer a few confidential enterprise files using the file transfer protocol (FTP). For ensuring utmost securi
Sav [38]

Considering the situation described above, to ensure utmost security, the variant of FTP people should choose is <u>SFTP</u>.

<h3>What is SFTP?</h3>

SFTP is the acronym for Secure File Transfer Protocol (SFTP). It functions through the Secure Shell (SSH) data stream to create a secure connection.

SFTP is generally known for providing excellent protection for file transfer.

<h3>Other types of FTP</h3>

  • Anonymous FTP
  • Password Protected FTP
  • FTP Secure (FTPS)
  • FTP over explicit SSL/TLS (FTPES)

Hence, in this case, it is case, it is concluded that the correct answerer is <u>SFTP</u>.

Learn more about file transfer protection here: brainly.com/question/17506968

5 0
2 years ago
Other questions:
  • A network is a group of two or more computers that are connected to share resources and information. T or f
    11·2 answers
  • Explain Software licensing
    12·1 answer
  • Prove each statement using a proof by exhaustion. For every integer n such that 0 lessthanorequalto n &lt; 3, (n + 1)^2 &gt; n^3
    9·1 answer
  • What term identifies the physical interface between a computer and its peripherals?
    5·1 answer
  • The underline format underlines the entire cell, not just the characters in the cell. true or false.
    12·1 answer
  • A misplacement of punctuation or spacing in a command during programming that causes the program to stop running is most
    9·2 answers
  • Which type of storage disk and disk drive can you use in the given situation?
    9·1 answer
  • What is the full form of MPEG?<br> The full form for MPEG is ________.
    9·1 answer
  • The ____ statement can be used to eliminate the use of certain (flag) variables.
    7·1 answer
  • Which type of software is offered in trial form or for a limited period of time?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!