Why doesn't the code "int a = 1000, b = 1000;
long int c = a * b;" work?
Answer Posted / thirupathi reddy katkoori
Integer range exceeds if multiply both the variables the resultant value does not to store it. Due to exceeding the int range only we have to declare it as long int and the value is store in c
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the types of variables in c?
What are the modifiers available in c programming language?
how can I convert a string to a number?
What is difference between main and void main?
What are high level languages like C and FORTRAN also known as?
What are the advantages and disadvantages of a heap?
What functions are used in dynamic memory allocation in c?
Is exit(status) truly equivalent to returning the same status from main?
What are the parts of c program?
What is a pointer variable in c language?
What is floating point constants?
When should a type cast be used?
Why isn't any of this standardized in c? Any real program has to do some of these things.
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
Are there any problems with performing mathematical operations on different variable types?