Write an if statement that assigns 100 to x when y is equal to 0.
*/
Code :
#include<iostream>
using namespace std;
void main()
{
int x=0,y=0;
cout<<"Enter the value of x = ";
cin>>x;
cout<<"Enter the value of y = ";
cin>>y;
if(y==0)
{
x=100;
}
cout<<"The value of x = "<<x<<endl;
cout<<"The value of y = "<<y<<endl;
}
0 Questions:
Post a Comment