C# program to calculate the total of employee\'s salaries using the Aggregate() method
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Program:
The source code to calculate the total of employee's salaries using the Aggregate() method, is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.
Output:
Explanation:
In the above program, we created the Employee class that contains the ID, Name, Salary, Department, and Main() method. In the Main() method, we created a list of employees.
In the above statement, we calculated the total of all employee's salaries using the Aggregate() method and then print the total of salary on the console screen.