Created
          May 28, 2021 09:38 
        
      - 
      
 - 
        
Save bijay-shrestha/ef514d18b227778629c37cab11fb00ac to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /** | |
| * Calculate an array of 5 floats and calculate their sum. | |
| */ | |
| package com.hawa.practice; | |
| import lombok.extern.slf4j.Slf4j; | |
| @Slf4j | |
| public class PracticeSetOne { | |
| public static void main(String[] args) { | |
| float sum = 0f; | |
| float[] floatNumbers = {1.0f, 2.14f, 3.15f, 4.0f, 5.12f}; | |
| for (float num : floatNumbers) { | |
| sum += num; | |
| } | |
| log.info("The sum of float numbers in a array {} is {}", floatNumbers, sum); | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment