1. Engineering
  2. Computer Science
  3. in c the fundamental type of int on the paceice...

Question: in c the fundamental type of int on the paceice...

Question details

In C++, the fundamental type of int on the PACE-ICE system uses 32 bits to represent an integer; however, you can extend this to 64 bits by using another fundamental type in C+t called long long. (Please note that these sizes can vary from platform to platform and are not guaranteed in the C standard which we will talk about in class.) I would like for you to write a program to calculate the results of 5 for n-1,2, 3, 4,... using first the int type and then the long long type. Please empirically show the maximum value of n that can still store the results of 5 in an int, and long long variables without overflow. In addition to the main() function, to get practice using global functions, I would like for you to create two global functions to calculate the value of 5 These two global functions should have one argument that is an int n. The first should return an int, and the second should return a long long so that you can compare the ranges of these two data types. In your Labl folder, please call your source code lab1part1.cc. Sample output for this program up to 5 is shown below Please follow this output format; until one step past the maximum value 5 to the n power results using int 51-5 52 -25 53 = 125 5 to the n power results using long int 51-5 52-25 53-125

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution