Welcome to AMIE Study - AMIE India Students Forum

AMIE Study - AMIE India Students Forum

collapse collapse

* Shoutbox

Refresh History
  • [email protected]: Sir how to paid online fee
    September 09, 2019, 08:21:27 PM
  • imgk1985: Middle of Sep 2019.
    September 03, 2019, 12:12:49 PM
  • ad13feb: Good evening.. Date of section B result ?
    August 31, 2019, 03:31:54 PM
  • vae: hello
    August 26, 2019, 02:33:54 PM
  • imgk1985: Very Good Afternoon folks.
    August 23, 2019, 11:58:19 AM
  • vae: good morning
    August 19, 2019, 10:56:58 AM
  • ramajit: Section B results expecting by Sep 1st week
    August 14, 2019, 09:26:41 AM
  • imgk1985: When Can we expect Section B - Summer 2019 results?
    August 13, 2019, 02:38:02 PM
  • ramajit: Results of Section A for Summer 2019 exam have been declared. Click to View ...
    August 09, 2019, 09:50:12 AM
  • vae: Good Morning and wishing everyone a good month..........August
    August 01, 2019, 10:06:30 AM
  • vae: Good Morning
    July 31, 2019, 09:21:57 AM
  • vae: Hello every1
    July 22, 2019, 09:29:29 AM
  • vae: Encumbrance Certificate
    July 08, 2019, 02:47:40 PM
  • vae: Happy July 2019
    July 01, 2019, 12:34:44 PM
  • vae: Hello
    July 01, 2019, 12:34:32 PM
  • vae: Good Afternoon every1
    June 27, 2019, 02:23:34 PM
  • vae: hi
    June 23, 2019, 03:57:08 PM
  • Sujith Raj (AMIE - Civil): Download FUNDAMENTALS OF DESIGN AND MANUFACTURING -SUMMER 2015- Question Paper.---> CLICK---> [link] Raj (AMIE,CEng- Civil)
    June 18, 2019, 10:38:44 PM
  • Sujith Raj (AMIE - Civil): AMIE Section B Syllabus - Civil Engineering-----Link--->[link] ---->>>--->>> [link]  Thanks Sujith Raj (AMIE, Chartered Engineer - Civil)
    June 14, 2019, 12:13:57 PM
  • vae: Good Morning
    June 13, 2019, 09:30:47 AM

* Search


* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Board Stats

  • stats Total Members: 48954
  • stats Total Posts: 27556
  • stats Total Topics: 6679
  • stats Total Categories: 6
  • stats Total Boards: 31
  • stats Most Online: 626

Author Topic: PROGRAM TO CALCULATE GROSS SALARY  (Read 2285 times)

Description:
February 22, 2009, 06:01:07 PM
  • Administrator
  • Senior Member
  • *****
  • Posts: 2173
  • Luck is for lazies, success is for who work hard
    • View Profile
    • AMIE Online Coaching
Advertisement
/* PROGRAM TO CALCULATE GROSS SALARY */

Code: [Select]
#include<stdio.h>
#include<conio.h>

main()
{float sal,hr,da,gross_sal;
printf("enter basic pay");
scanf("%f",&sal);
house_rent=0.2*sal;
da=0.4*sal;
gross_sal=sal+hr+da;
printf("gross salary=%.2f",gross_sal);
getch();
}


 
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »


Praveen
AMIE Study
February 26, 2009, 10:07:33 AM
Reply #1
  • Super Member
  • Registered User
  • *
  • Posts: 20
    • View Profile
is it  programe c or c++??
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »
February 26, 2009, 10:22:05 AM
Reply #2
  • AMIE Forum Advisor
  • Senior Member
  • **
  • Posts: 820
    • View Profile
It's a C programme.

Komal
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »
Komal Maskariya
AMIE (Chemical Engg)
Chartered Engineering, India
AMIE study notes
Excellence Academy
February 26, 2009, 11:26:08 AM
Reply #3
  • Administrator
  • Senior Member
  • *****
  • Posts: 2173
  • Luck is for lazies, success is for who work hard
    • View Profile
    • AMIE Online Coaching
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »
Praveen
AMIE Study
March 19, 2010, 08:52:02 PM
Reply #4
  • Super Member
  • Registered User
  • *
  • Posts: 28
    • View Profile
in this program no values for D.A and HRA etc etc?
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »
April 13, 2010, 04:57:47 AM
Reply #5
  • Super Member
  • Senior Member
  • **
  • Posts: 107
    • View Profile
Hello Friends.
As I study the previous question paper and i found that C++ questions are more often than C program.
What is your Opinion, should we concentrate more on C++ or C ? because on both once its getting difficult.
Thanks. Regards
Irfan
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »
Thanks & Best Regards -
Irfan M Ansari  - Section B - Civil
Bhiwandi - Dist THANE // MAHARSHTRA
Email :[email protected]
IM: [email protected]
August 19, 2012, 07:08:45 PM
Reply #6
  • Super Member
  • Registered User
  • *
  • Posts: 61
    • View Profile
Hi All

Quote from: "praveen"
/* PROGRAM TO CALCULATE GROSS SALARY */

Code: [Select]
#include<stdio.h>
#include<conio.h>

main()
{float sal,hr,da,gross_sal;
printf("enter basic pay");
scanf("%f",&sal);
house_rent=0.2*sal;
da=0.4*sal;
gross_sal=sal+hr+da;
printf("gross salary=%.2f",gross_sal);
getch();
}


 

In the above programme there are small observations

1. The variable "house_rent" is not declared (i think "hr" is "house_rent" either "hr" may be changed as house_rent or vice versa in the programme)

2.  I have given output for each calculated variable, like DA, HRA

3. And the code "n" makes space between each line in the output.

2. So the programme after modifications is given below:


 
Code: [Select]
#include<stdio.h>
    #include<conio.h>

    main()
    {float sal,hr,da,gross_sal;
    printf("Enter basic pay: ");
    scanf("%f",&sal);
    hr=0.2*sal;
    da=0.4*sal;
    gross_sal=sal+hr+da;
    printf("Basic salary=%.2f",sal);  
    printf("House rent Allowance=%.2fn",hr);  
    printf("Dearness Allowance=%.2fn",da);
    printf("Gross salary=%.2fn",gross_sal);
    getch();
    }

The output will look like this:

[attachment=0:2x6qauh2]Gross Salary.jpg[/attachment:2x6qauh2]
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »
 

Related Topics

  Subject / Started by Replies Last post
3 Replies
1235 Views
Last post March 23, 2011, 04:07:44 PM
by ram1ramji
0 Replies
1476 Views
Last post December 18, 2010, 05:02:25 PM
by karthick_l
0 Replies
590 Views
Last post August 31, 2011, 03:46:27 PM
by Manukpillai
0 Replies
1961 Views
Last post September 22, 2011, 12:49:13 PM
by prayrona
0 Replies
855 Views
Last post September 07, 2012, 02:33:11 AM
by sainathan
3 Replies
1498 Views
Last post January 13, 2013, 12:03:03 PM
by spganeshk
6 Replies
2388 Views
Last post September 28, 2014, 06:12:14 PM
by rahulm500

* Search

* Subscribe to Forum

Enter your email address:

Advertisement

* Recent Posts