long long division in c -


am trying pass along "long long" number, problem when try divise number 10 , answer incorrect ..

#include <stdio.h> int main(void) {     int n = 0 ;     long long s = 4111111111111111;      n = s % 10 ;     printf("n after modulos %i\n",n );      s = s / 10 ;     printf("this s after division %llo \n",s  );       return 0; } 

output :

n after modulos 1 s after division 13536350357330707  

printf("this s after division %llo \n",s  );                                    ^ (this prints (correct)value in octal representation) 

use specifier %lld (to value in decimal ) .


Comments

Popular posts from this blog

xml - Extract substrings with XSLT -

math - "ELO Rating" and how does "TSR Rating" work? -

How can do a tuple comparison in coffeescript similar to that in python? -