Welcome to AMIE Study - AMIE India Students Forum

AMIE Study - AMIE India Students Forum

collapse collapse

* Shoutbox

Refresh History
  • vae: hi
    May 19, 2019, 03:21:54 PM
  • raviteja2412: I need mining engineering previous years question paper can anyone help me
    May 13, 2019, 06:20:39 PM
  • vae: Good afternoon every1
    May 09, 2019, 01:14:34 PM
  • vae: IMNA : EXCELLENT TUITIONS  136, First Floor, Above Raghavendra Enterprises, Coconut Avenue, 8th Cross, Malleswaram, Bangalore 560 003, India.  Phone: +91 9844027371
    May 02, 2019, 05:13:30 PM
  • vae: hellooooooooooooooooooooo
    May 02, 2019, 12:36:53 PM
  • vae: Shantanu09 - You can get the full notes if  U follow the link : [link]
    May 01, 2019, 12:44:07 PM
  • vae: Dear Shahul, kindly follow the link : [link] where you can get all details
    May 01, 2019, 12:42:37 PM
  • shantanu09: HLW everyone, can anyone send me notes for material scienece
    April 30, 2019, 05:43:38 PM
  • shahul: Any one can guide me, to join new membership ST (Diploma stream) by online???
    April 30, 2019, 04:30:47 PM
  • shahul: Good evening
    April 30, 2019, 04:29:18 PM
  • vae: Hi
    April 29, 2019, 12:42:11 PM
  • imna: i am looking for coaching class in Bangalore. Please I need guidance
    April 28, 2019, 09:42:40 AM
  • imna: hello anyone from bangalore?
    April 28, 2019, 09:37:41 AM
  • T-1700565: Please send AN 205 and AN 210 NOTES
    April 25, 2019, 10:06:09 PM
  • vae: Good Afternoon Everyone
    April 25, 2019, 10:36:29 AM
  • vae: Happy Easter Every1
    April 21, 2019, 12:53:46 PM
  • RK Electrical: Can anyone send me the fundamentals of design and manufacturing pdf book link?
    April 16, 2019, 10:29:00 PM
  • vae: Happy Vishu...Everyone
    April 15, 2019, 11:30:44 AM
  • vae: hello
    April 14, 2019, 12:45:51 PM
  • SUJEET KUMAR MISHRA: Good afternoon sir, mujhe sec-a, material science ka  notes  chahiye sir
    April 13, 2019, 10:40:49 AM

* Search


* User Info

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

* Board Stats

  • stats Total Members: 48881
  • stats Total Posts: 27506
  • stats Total Topics: 6655
  • stats Total Categories: 6
  • stats Total Boards: 31
  • stats Most Online: 626

Author Topic: PROGRAM TO CALCULATE GROSS SALARY  (Read 2227 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
1173 Views
Last post March 23, 2011, 04:07:44 PM
by ram1ramji
0 Replies
1435 Views
Last post December 18, 2010, 05:02:25 PM
by karthick_l
0 Replies
560 Views
Last post August 31, 2011, 03:46:27 PM
by Manukpillai
0 Replies
1891 Views
Last post September 22, 2011, 12:49:13 PM
by prayrona
0 Replies
810 Views
Last post September 07, 2012, 02:33:11 AM
by sainathan
3 Replies
1430 Views
Last post January 13, 2013, 12:03:03 PM
by spganeshk
6 Replies
2296 Views
Last post September 28, 2014, 06:12:14 PM
by rahulm500

* Search

* Subscribe to Forum

Enter your email address:

Advertisement

* Recent Posts

Re: All About AMIE by vae
[May 09, 2019, 04:40:15 PM]


Re: All About AMIE by vae
[May 09, 2019, 04:26:26 PM]


Re: All About AMIE by vae
[May 09, 2019, 01:12:24 PM]


Re: All About AMIE by vae
[May 09, 2019, 01:03:32 PM]


Re: All About AMIE by vae
[May 08, 2019, 04:59:27 PM]