Saturday, 23 March 2013

using C++ structure call the paramters to make Calculator program



#include<iostream.h>

struct dis
{
 int num; int num2;
};

void main()
{
dis x,y;
 cout<<"enter the first number & second number = ";
  cin>>x.num>>y.num2;
 cout<<"\nadd = "<<x.num+y.num2;
 cout<<"\nsub = "<<x.num-y.num2;
 cout<<"\nMultiply = "<<x.num*y.num2;
 float g; g=x.num/y.num2;
 cout<<"\nDivide = "<<g;
}