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

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -