Write a program to read the monthly salaries
of 5 workers given by a company. Calculate the
total amount paid by the company to the workers.
Answers
Answered by
1
import java.util.Scanner
class salary
{
public static void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("enter the salary of 5 workers");
int w1 = sc.nextInt();
int w2= sc.nextInt();
int w3 = sc.nextInt();
int w4= sc.nextInt();
int w5 = sc.nextInt();
int total = w1+w2+w3+w4+w5;
System.out.println("The total amount paid by the company to the workers = " + total);
}
}
The above program is done in java.
hope u understand....
please mark it as brainlist
Similar questions