Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Macro with variables

psppbpsppb Member Posts: 1
I am attempting to extend my knowledge of C and am working through a chapter on Macros. I am trying to create a macro that will return TRUE of the input is divisible by ten otherwise FALSE

Here is my code

/* Macro funcions*/
#define modulus(x) {if(x%10 == 0){printf("true
"); else printf("false

/* Declare variables*/
float centi;
float fahr;
char line[100];

int main()
int count = 12;

system("pause"); /* the fix for the collapsing window*/
return (0);

Something is wrong before the else statement in the macro and I cannot figure it out.

Thank you!
Sign In or Register to comment.