Why doesn't the code "int a = 1000, b = 1000;
long int c = a * b;" work?
Answer Posted / larry
This won't work if int is a 16-bit size because 1000000 >
32767 (2 to the 15th - 1). It will work when int is a 32-
bit number. It will work if you cast a or b to a long.
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What are pointers? What are different types of pointers?
Are c and c++ the same?
What is the argument of a function in c?
given post order,in order construct the corresponding binary tree
What is string in c language?
How many bytes are occupied by near, far and huge pointers (dos)?
What is sizeof return in c?
What are comments and how do you insert it in a C program?
What is the scope of global variable in c?
Explain what standard functions are available to manipulate strings?
What is an example of structure?
What does c mean before a date?
What is file in c language?
How do you define a function?
Can you please explain the difference between exit() and _exit() function?