Input consists of 4 integers. First two inputs correspond to the value of the first dollar and cent. Next two inputs correspond to the value of the second dollar and cent. Output should print the sum of dollar and cent.c++program code
Answers
Answered by
4
Answer:
#include<iostream>
using namespace std;
int main()
{
int dollar, cent, dollar1, cent1;
std::cin>>dollar>>cent>>dollar1>>cent1;
int Totaldollar=dollar+dollar1;
int Totalcent=cent+cent1;
while(Totalcent>100)
{
Totalcent=Totalcent-100; /*Conversion for cents to dollar*/
Totaldollar=Totaldollar+1;
break;
}
std::cout<<Totaldollar<<"\n"<<Totalcent;
return 0;
}
This program is written in C++ programming language.
Answered by
2
Answer:
Answer:#includeusing namespace std;int main(){int dollar, cent, dollar1, cent1;std::cin>>dollar>>cent>>dollar1>>cent1;int Totaldollar=dollar+dollar1;int ... More
Similar questions