Answer to Question #222902 in Algorithms for hay

Question #222902

Question 2

Using C or C++ or a program of your choice, write a program that list the storage size of a float, list the minimum and maximum float values, and the precision of the float.


Question 3

Describe the steps of how you will compile the program written in Question 2 above in a typical compiler such as gcc or a compiler of your choice. Show the output of how you have compile the program written in Question 2 above and attach all files generated where applicable.


1
Expert's answer
2021-08-03T15:09:58-0400
Question 2

#include<stdio.h>




int main(){
	int i=0;
	float values[]={456.5464654,56.235464,1335.5464,789.465,13.56432};
	float min=values[0];
	float max=values[0];
	
	for(i=1;i<5;i++){
		if(max<values[i]){
			max=values[i];
		}
		if(max>values[i]){
			min=values[i];
		}
	}


	printf("Min value is: %.5f\n",min);
	printf("Max value is: %.5f\n\n",max);
	



	return 0;
}


Question 3


Use Cygwin64 Terminal program to compile and run the program





Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS