c++ - Why is long long value not printed correctly? -


why long long value not printed expect in following code snippet?

#include <stdio.h>  int main() {     int x = 1363177921;     long long unsigned y = x * 1000000;     printf("y: %llu\n", y); // why 1363177921000000 not printed?     return 0; } 

it's not printing that's @ fault. have integer overflow in:

long long unsigned y = x * 1000000; 

change to:

long long unsigned y = x * 1000000ull; 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -