Computer Science, asked by rithisha21, 1 year ago

suppose x and y are two double type variable that you want add as integer and assign to an integer variable . construct a C++ statement for the doing so

Answers

Answered by siddhartharao77
8

#include<iostream>

using namespace std;

int main()

{

double x,y;

int z;

cout << "Enter two numbers : " ;

cin >> x >> y;

z = int (x + y);

cout << "The addition of two numbers is : " << z << endl ;

return 0;

}


Output:

Enter two numbers : 10.5 12.3

The addition of two numbers is 22.



Hope it helps!


rithisha21: thanks dear
Ajalwi: You are welcome
rithisha21: i didn't say to u
rithisha21: i said to Siddharth
siddhartharao77: Welcome rithisha21
rithisha21: r u in class 11
rithisha21: ??
siddhartharao77: I am not a student.Brainly teacher!
rithisha21: oh
rithisha21: ok sir
Similar questions