What is the output of print (int (3.79) +int(2.1))?
The output of the following program will be: 5
Because if you are adding two floating numbers but you are using the int data type, In this case, the int data type stores only integer numbers not float numbers. Hence the output is 5.
I will show you the output using the program in C language:
- #include<stdio.h>
- int main()
- {
- int sum;
- sum = (int (3.79) +int(2.1));
- printf("%d",sum);
- }
Comments
Post a Comment