C++ trouble?

I am having trouble to simplify the answer.

using namespace std;

int main(){

double dblA, dblB, dblC, dblD, dblproductN, dblproductD,dblsumN,dblsumD, dblGCF, dblsimplifyNsum, dblsimplifyDsum;

double dblsimplifyNproduct, dblsimplifySproduct;

int M,N;

int R=M%N;

while(R!=0)

{M=N;

N=R;

R=M%N;}

{

cout<<"Enter the numerator and the denomenator of the first positive fraction separated by a space=>"<<endl;

cin>>dblA>>dblB;

cout<<"Enter the numerator and the denaminator of the second positive fraction separated by a space=>"<<endl;

cin>>dblC>>dblD;

dblproductN =(dblA*dblC);

dblproductD =(dblB*dblD);

dblsumN = (dblA*dblD)+(dblC*dblB);

//dblGCF = N;

//dblsimplifyNsum= (dblsumN)/(dblGCF);

//dblsimplifyDsum= (dblproductD)/(dblGCF);

//dblsimplifyNproduct= (dblproductN) / (dblGCF);

//dblsimplifySproduct = (dblproductD) / (dblGCF);

cout<<"the sum of the fractions is" <<dblsu

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Copyright © 2024 VQUIX.COM - All rights reserved.