Define a function PrintFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. End with a newline. Ex: PrintFeetInchShort(5, 8) prints: 5' 8" Hint: Use \" to print a double quote.

Respuesta :

Answer:

The solution code is written in C++

  1. #include <iostream>
  2. using namespace std;
  3. void PrintFeetInchShort(int numFeet, int numInches){
  4.    cout<<numFeet<<"\'"<<numInches<<"\""<<"\n";
  5. }
  6. int main()
  7. {
  8.    PrintFeetInchShort(5, 8);
  9.    
  10.    return 0;
  11. }

Explanation:

Firstly, create a function  PrintFeetInchShort that takes two integers, numFeet and numInches (Line 5). Display the numFeet followed by a single quote, '. To print the single quote, we can use the escape sequence, \'. (Line 6)

After the single quote, it is followed with numInches and then a double quote ". The double quote is printed using another escape sequence , \".

Finally print the new line, "\n"  

ACCESS MORE