Answer:
// here is program in C++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variable
int price;
cout<<"enter the price: ";
// read the price
cin>>price;
// find the dollars
int doll=price/100;
// find the cents
int cent=price%100;
// print the dollars and cents
cout<<doll<<" dollars and "<<cent<<" cents.";
return 0;
}
Step-by-step explanation:
Read the price from user and assign it to variable "price".Then find the dollars by dividing the price with 100 and to find cents calculate modulus 100 of price. Then print both the value.
Output:
enter the price: 4321
43 dollars and 21 cents.