Answer to Question #285340 in C for lintik

Question #285340

3. Float Count-off


Counting off a list of float numbers is hard when you speak it, but not when you code it! Don't believe me? Then let's try coding just that!


Instructions:

  1. An array containing 30 predefined float values are already provided for you in the code editor. Print each of the element out in separate lines, starting from the last array element down to the first.
  2. Each outputted value must also only show up to two decimal places.

Output

Multiple lines containing a float number.

2.41
143.00
3.14
3.12
0.00
-321.12
-414.12
12312.10
4.10
2.42
.
.
.
1
Expert's answer
2022-01-07T07:45:11-0500
#include<stdio.h>  


int main(){
	float numbers[]={2.41,143.00,3.14,3.12,0.00,-321.12,-414.12,12312.10,4.10,2.42,
		2.41,143.00,3.14,3.12,0.00,-321.12,-414.12,12312.10,4.10,2.42,2.41,143.00,
		3.14,3.12,0.00,-321.12,-414.12,12312.10,4.10,2.42};
	int i;


	for(i=0;i<30;i++){
		printf("%.2f\n",numbers[i]); 
	}


	
	


	getchar();
	getchar();
	return 0;  
}   

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
New on Blog
APPROVED BY CLIENTS