Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- int main() {
- char x, a; double f, i, r; std::string operation;
- std::cout << "If you want to conversion of foots in inches then write f" << "\n" << "If you want to conversion of inches in foots then write i" << std::endl;
- do {
- std::cout << "What operation do you want to do ? " << std::endl;
- std::cin >> x;
- if (x == 'f') {
- std::cout << "How many foots?" << std::endl;
- std::cin >> f;
- r = f * 12;
- std::cout << "In " << f << " foots " << r << " iches" << std::endl;
- }
- else if (x == 'i') {
- std::cout << "How many iches?" << std::endl;
- std::cin >> i;
- r = i / 12;
- std::cout << "In " << i << " iches " << r << " foots" << std::endl;
- }
- else { std::cout << "You didn't write what operation do you want to do. Try again." << std::endl; }
- std::cout << "Continue? (y or n)" << std::endl;
- std::cin >> a;
- } while (a = 'y' || a!='n');
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement