Computer Science, asked by yokeshdhanabalan, 10 months ago

write a c++ program to add two dollars and cents

Answers

Answered by Yamini1999
1

Answer:

#include<iostream>

using namespace std;

int main()

{

int d1,c1,d2,c2;

cin>>d1>>c1>>d2>>c2;

int D=d1+d2;

int C=c1+c2;

while(C>100)

{

D=D+(C/100);

C=C%100;

break;

};

cout<<D<<"\n"<<C;

return 0;

}

Answered by lsrinija
0

Answer:

Explanation:

#include<iostream>

using namespace std;

int main()

{

 //Type your code here.

 int a,s,d,f,b,c,k;

 std::cin>>a>>s>>d>>f;

 c=s+f;

 k=c/100;

 c=c%100;

 b=a+d+k;

 std::cout<< b<<"\n"<<c;

}

Similar questions