Assignment 4
Assignment 4
Declare
another variable of type short and assign a value 12345 to it.
Now add these two variables and print sum.
Q2 Now what happen if you try to store the above sum in a byte
variable? Is there any error? if yes, then explain why this error and fix
this error.
Q3. Declare a variable of type int and assign a value 4567L and explain
why are you getting this error?
Q4. Declare a variable of type int and assign 100 to it. Declare another
variable of type long and assign a value 200 to it. Now add these two
numbers and print sum.
Q5 What happens if you try to store the above sum in int variable. Is
there any error? If yes then explain why this error and fix the error.