tags:

views:

83

answers:

3

Hello.

I've got a variable:

int Result = 42 % 84;

However its returning null on NSLog?

+6  A: 

To NSLog an integer, use %d.

int result = 42 % 84;
NSLog(@"%d", result);
KennyTM
still not working
Daniel
@Daniel: Show us more of your code.
KennyTM
@Daniel: Also, define "not working." An error? Output doesn't match expectations? Be specific, please.
David
What do you mean by not working? Where are you putting the code? What output is logged? Is there an error message?
Amorya
A: 

How does it return null in NSLog? Did you write "%@"?

John Smith
+2  A: 
int r=42%84;
NSLog(@"%d", r);

The above code logs 42 for me.

Amorya