Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task 2: Finding data ranges in a simple program (4 marks) We learned numeric ranges in Week 2 for different data types. A sample C
Task 2: Finding data ranges in a simple program (4 marks) We learned numeric ranges in Week 2 for different data types. A sample C code is given below which you can compile and get results. You need to answer questions as provided below. \#include \#include int main() \{ int intType; float floatType; double doubleType; float x=10.327; int y=2147483647; int y1 = 2147483648; printf("The float value : \%f(n", x ); printf("The int value : \% d ,y); printf("The int value : %d ", y1); printf("Size of int: \%zu bytes \ "", sizeof(intType)); printf("Size of float: \%zu bytes ", sizeof(floatType)); printf("Size of double: \%zu bytes \ n", sizeof(doubleType)); return 0 ; \} Q1: Considering what we learned in Week2, what results you are getting for variable y and y1? Explain, why these two values are different? Q2: What float value was displayed when you compile this code and why? What does float correspond to in IEEE 754 format and what determines the total number of decimal places? Explain
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started