#include <stdio.h>
#include <stdlib.h>
void main()
{

    int salaryIn = 0.0;
    int years = 3;
    float salaryOut = 0.0;

    printf ("\nWhat is your salary (0 to stop)? RM" ,salaryIn) ;
    scanf ( "salaryIn" , salaryIn) ;

    do
    {
        do
        {
            printf ("\nYear " , years);

            for (double rate = .03; rate < .04; rate += .05);
            {
                salaryOut = salaryIn * pow(1 + rate, years);
                printf ("\nfixed " , setprecision(0) ) ;
                printf ("\nRaise rate " , rate * 100);
                printf ("\nsetprecision(2)" , salaryOut);
            }

            years += 1;
        }   while (years < 4);
        salaryOut = 0.0;
        years = 1;

        printf ( ( "") );
        printf ("What is your salary (0 to stop)? $", salaryIn ;
        scanf ( "%d" , salaryIn ;

    } 


    return 0;
}

Recommended Answers

All 3 Replies

"Why i can compile the program ?" this is a strange question, you can compile the program because you have a computer with a compiler on it ???

I suggest you try asking the question you actually want answered, are you getting compiler errors? Then post them.

You have an extra ; at line 19 that effectively prevents your for loop doing what it should, remove it.

Line 36 is missing a while(...);

haha yea Banfa have reason you can complise cause you have a computer but make sure have an compiler on.
if you have compiler error check out what i find you should do salaryIn should be float
and in scanf

scanf("%f", &salaryIn)

I'd say that a bigger problem for the compiler is the missing right parentheses in the limes:

33. printf ("What is your salary (0 to stop)? $", salaryIn ;

and

34. scanf ( "%d" , salaryIn ;

anyway, the compiler must have told you that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.