Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

uaecasher

macrumors 65816
Original poster
Hello,

i have written this code:

Code:
#include <stdio.h> 
int main (void) 
{ 
	
	int a = 15;
	int b = 35;
	
	
printf("a / b * b = %i\n", a / b * b);

	
}

the result i get is zero, but it should be 15, why I'm getting a 0

thanks
 
Hello,

i have written this code:

Code:
#include <stdio.h> 
int main (void) 
{ 
	
	int a = 15;
	int b = 35;
	
	
printf("a / b * b = %i\n", a / b * b);

	
}

the result i get is zero, but it should be 15, why I'm getting a 0

thanks

It should be zero. Buy a C book for beginners.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.