Answer:
The value of the following variable is given below:
x=2
y=7
p=7
z=3
w=3.5
Step-by-step explanation:
Following are the program in c++
#include <iostream>// header file
using namespace std; // namespace
int main() // main function
{
int x = 2; // variable declaration
int y = 7; // variable declaration
double p = 7.0; // variable declaration
int z = y / x; // variable declaration
double w = p / x; // variable declaration
cout<<" The value of following variable is given as:"<<endl<<"x:"<<x<<endl<<"y:"<<y<<endl<<"p:"<<p<<endl<<"z:"<<z<<endl<<"w:"<<w;// print all the statement
return 0;
}
Output:
x:2
y:7
p:7
z:3
w:3.5
Here the variable x is initializes by 2 ,y is initializes by 7 and p is initializes by 7.The variable z=y/x gives 3 and variable w=p/x gives 3.5 because variable w is double type