Search This Blog

Thursday 28 January 2016

Write a program to read the values of a, b and c and display the value of x, where x = a/(b-c)

#include<iostream>

using namespace std;

int main()
{
int a,b,c,x;
cout<<"Enter a b & c for x=a/(b-c)"<<endl;
cin>>a>>b>>c;
if(b-c==0)
{
cout<<"Division not possible";
}
else
{
x=a/(b-c);
cout<<"x is:"<<x;
}
return 0;
}

7 comments: