answersLogoWhite

0


Best Answer

int num1 = 1;

int num2 = 50;

int addition = num1 + num2;

User Avatar

Wiki User

โˆ™ 15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

โˆ™ 14y ago

int a=2, b=3, c=a+b;

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Code to add 2 integer numbers without using int float and double?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between integer numbers and float numbers?

Integer numbers : ...-5,-4,-3,-2,-1,0,1,2,3,4,5... Float numbers 1.25, 1.26 etc They are float numbers because its value can be altered after the point, which is based on an integer number.


What happens when java program attempts to divide one integer by another?

In that case, unless you specifically convert ("cast") at least one of the numbers to a double or float, the result will also be an integer. Example: 1 / 3 = 0


Can an integer be 3 and a half?

No, an integer cannot contain a decimal place. Instead consider using a double or a float for decimals.


What does the float do in java like declare blablabla as float?

float and double are types of numbers that accept decimals. Consider them as numbers in scientific notation. double allows a larger range of numbers than float, and more significant digits. Usually you would use double, unless you have some special situation, like a large array of numbers, and you decide the extra precision is not necessary.


is 47.47 an intger?

Nope. If itโ€™s a whole number, itโ€™s an integer. If itโ€™s a fraction without letters, itโ€™s a float


What is the benefit of float data type?

Floating type numbers can't be stored in integer type variables. If we do that then their fractional part will be lost. So, we use float data type to store numbers with fractional parts.


How do you write a C plus plus program to calculate the cube of integer float and double numbers?

The following C++ template function is all you need to calculate the cube of any arithmetic type: template<typename T> T cube (T val) { return val*val*val; } Usage: int x {cube<int> (42)}; float y {cube<float> (3.14)}; double z {cube<double> (x * y)};


What are two Java primitive types store floating-point numbers?

In Java, you can use either a float or a double


When you use decimal which type of data is it?

Decimal numbers are real numbers. In C and C++ we use the float, double and long double data types to represent real numbers.


Why float is not declared as int in java?

Because float is used for storing floating point numbers (values with decimal points and fractions) whereas int is used to store integer numbers (whole number) Storing a float in a int will result in loss of data which is not desirable and hence it is not done.


What is the range of float?

i wann't ask the range of double float and long double float??


Can an float value be assigned to int variable?

Yes, an integer can be assigned as a float value.But it get stored as a float value, that is an implicit type conversion occurs during compilation.Smaller data types are convertible to larger data types.eg:float b=12;// an integer constant is assigned to a float variableprintf("%f",b);// when printing b it will print as 12.000000