1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sedbober [7]
4 years ago
11

Write a C program to input basic salary of an employee and calculate gross salary according to given conditions.

Computers and Technology
1 answer:
kkurt [141]4 years ago
3 0

Answer:

Written in C

#include <stdio.h>

int main() {

   float salary;

   printf("Salary: ");

   scanf("%f", &salary);

   float HRA, DA;

   if(salary <= 10000){

       HRA = 0.20; DA = 0.80;

   }

   else if(salary >= 10000 && salary <= 20000){

       HRA = 0.25; DA = 0.90;

   }

   else{

       HRA = 0.30; DA = 0.95;

   }

   salary = salary + salary * HRA + salary * DA;

     printf("Gross Salary: %.2f\n", salary);

   return 0;

}

Explanation:

I've added the full program as an attachment where I used comments as explanation

Download txt
You might be interested in
A user has become compromised as a result of visiting a specific web page, without clicking on any kind of content. What type of
Nostrana [21]

Answer:

drive-by-download

Explanation:

3 0
3 years ago
Read 2 more answers
True of False - use T or F An abstract class can have instances created using the constructor of the class.
Sindrei [870]

Answer:

False

Explanation:

An instance of an abstract class cannot be created through the constructor of the class, because it does not have a complete implementation. Though, it is possible to have references of an abstract type class. Abstract classes are incomplete structures and you would have to build onto it before you are able to use it.

7 0
4 years ago
Assume that the int variables i, j and n have been declared , and n has been initialized . write code that causes a "triangle" o
SIZIF [17.4K]

Here you go,

class Program

   {

       static void Main(string[] args)

       {          

          int n,i,j;

          Console.Write("Enter size: ");

          n = Convert.ToInt32(Console.ReadLine());

          for (i = 1; i <= n; i++)

          {

              for (j = 1; j <= i; j++)

              {

                  System.Console.Write("*");

              }

              System.Console.Write("\n");

          }          

           Console.ReadLine();

       }

   }

5 0
3 years ago
How many worksheets display in the excel window when you create a new blank workbook?
zalisa [80]
By default it is 3 worksheets.  By default it is 3 worksheets. But it could be some settings that can change this quantity
4 0
4 years ago
Which are examples of traditional computer-based technology?
marta [7]

Answer:

Explanation:

Spreadsheet software is the correct answer

8 0
3 years ago
Read 2 more answers
Other questions:
  • A growling noise is heard only when the driver exerts force on the clutch pedal. No noise is heard when the clutch pedal is up.
    13·1 answer
  • A security system uses sensors at every door and window which will set off an alarm if any one of them is opened. There is also
    13·1 answer
  • Audrey would like to save her document. She should choose the Save command from the _____. folder menu window directory
    11·1 answer
  • Your mom calls you. She is creating a book of poetry. Many of these poems only take up the first half of a document . She asks i
    10·2 answers
  • What is Brainly?<br><br> A.Yes<br> B.No
    12·2 answers
  • Choose the reasons why Windows Server operating systems are a popular choice for a network because they _____. Select all that a
    12·1 answer
  • Major characteristics of the bus in computer architecture​
    8·1 answer
  • Decribe the advantages of using emails compared with physical faxing ?
    8·1 answer
  • You need to implement a class that represents the state of a room or game section. The class will contain a room_id, a descripti
    15·1 answer
  • When should you use an ELIF statement?<br> Edhesive
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!