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
Explain what is the use of a semicolon (;) at the end of every program statement?
What does printf does?
Explain how are 16- and 32-bit numbers stored?
What is main () in c?
What is a program flowchart and explain how does it help in writing a program?
define string ?
What is an lvalue?
Why is it usually a bad idea to use gets()? Suggest a workaround.
What are the standard predefined macros?
What does calloc stand for?
what is a constant pointer in C
Explain setjmp()?
What is advantage of pointer in c?
What are the advantages and disadvantages of a heap?
Explain the concept and use of type void.