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


Please Help Members By Posting Answers For Below Questions

What is the sizeof () operator?

616


What does 3 periods mean in texting?

593


Explain the use of #pragma exit?

690


How are variables declared in c?

596


What’s a signal? Explain what do I use signals for?

601






What are the different types of C instructions?

669


What is the benefit of using an enum rather than a #define constant?

652


Which is better malloc or calloc?

645


How do you do dynamic memory allocation in C applications?

626


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

594


When is a “switch” statement preferable over an “if” statement?

639


What is spaghetti programming?

664


Is c easy to learn?

552


How can I copy just a portion of a string?

811


hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel

1406