Thread: Basic Programm giving Error

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    15

    Basic Programm giving Error

    HeLLo.
    i M new & have written just a simple programm, but it is giving error.
    it compiles perfectly without errors but when i run it, it doesnt give the value as desired.

    PlS. Help
    i M attaching the C file which i have problem with

    Code:
    /*Ramesh's Basic Salary is input through Keyboard.
    His dearness allowance is 40% of basic salary, & 
    house rent is 20% of his basic salary.
    WAP to calculate his Gross Salary*/
    #include <stdio.h>
    #include <conio.h>
    int main ()
    {
    	float BS, GS, DA, HR;
    	clrscr ();
    	printf ("\nEnter your Basic Salary\n");
    	scanf ("%f",&BS);
    	DA = 40/100*BS;
    	HR = 20/100*BS;
    	printf ("\nYour Dearness Allowence is %f \n", DA);
    	printf ("\nYour House Rent Allowance is %f \n", HR);
    	GS = BS+HR+DA;
    	printf ("\nYour GROSS SALARY is %f\n", GS);
    	getch();
    	return 0;
    }
    Which compiler to use ???
    i M using Turbo C++, but having gr8 troubles with it.
    'coz i m using Windows 7 & in that dos doesnt support fullscreen.
    So its a big problem.

    PlS. tell me a good compiler
    Last edited by dharmil007; 05-26-2010 at 07:55 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 04:09 AM
  2. how do you resolve this error?
    By -EquinoX- in forum C Programming
    Replies: 32
    Last Post: 11-05-2008, 04:35 PM
  3. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  4. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  5. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM