Tuesday, July 14, 2009

Fellow c programmers i need HELP!!! with my program?

i need to remove the return statements from my if statment and make the program not continue after the error message. i also need to make else statements that just continue the program.....thank you





#include%26lt;stdio.h%26gt;


int main( )


{


float a,b,c,d,e,f;


d=40;


e=1;


f=6.75;


printf("***WAGE CALCULATOR***\n\n") ;


printf("How many hours did you work this week?: ") ;


scanf("%f",%26amp;a);


if (a%26gt;d) {


printf("\nError more then 40 hour.\n",a);


return 0;


}


printf("\nWhat is your hourly wage?: ") ;


scanf("%f",%26amp;b);


if (b%26lt;f) {


printf("\n ERROR value under 6.75 not accepted");


return 1;


}


c=a*b;


printf("\nyour gross salary is: $%f\n",c);











return ( );





}

Fellow c programmers i need HELP!!! with my program?
PROGRAMMING TIP...





WrItE yOuR cODE sO iT Is eASy tO rEaD!!!





Thus changes to be made are all that much easier.





The tab format is lost in the edit box here,


so just align the { } brackets to see the nested if-else statements.


No comments:

Post a Comment