I am writing just these four lines in ViewDidLoad, and facing unexpected output,
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
float a = 15.264;
NSLog(@"FLoat is %f",a);
float b = 10/60;
NSLog(@"FLoat is %f",b);
}
In first float a is displaying correct value which is being assigned to a, but b is displaying 0.0000, why?
try this,
float b = 10.0/60.0,
bcox, just 10/60 return int