#Why is my code red in ++?

1 messages · Page 1 of 1 (latest)

lilac knoll
#
#include<stdio.h>

int main(){
    float d,e;

    d = ++5 *3 / 6 % 7;
    e = 3 * 2++ -4 * 7;

    return 0;
}
hazy creekBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

serene quest
#

You can't ++5.

#

It's for changing the value of a variable. 5 is not a variable.

lilac knoll
#

ah I should have made a variable, is it like this?

#include<stdio.h>

int main(){
    float d,e;
    int i=5, u=2;

    d = ++i *3 / 6 % 7;
    e = 3 * u++ -4 * 7;

    return 0;
}
serene quest
#

Yes.

lilac knoll
#

oky thanks

#

!solved