0
C ++ problem with numbers
I need to check are there floats that ends with .0 and convert them to integers. How can I do that? For example if a = 2.0, i need to find that float and turn it to integer -a = 2?
4 ответов
+ 1
suppose you find the addition of 2 float no. and want to convert the final result in integers, You can simply write as result= int("what ever u want to convert") . May be I am wrong but u can try this
0
#include <iostream>
using namespace std;
int main() {
Int x, y;
int sum;
cout << "type a number";
cin >> x;
cout << "type another number";
cin >> y;
sum = x + y;
cout << "sum is " << sum endl;
return 0;
}
0
Please what's wrong with the above code?
0
What result u want through this code?Logout Kwaku