Let us assume the program below runs smoothly, identify all function arguments in each function call in exact order and separate each argument in just a comma:
int getCube(int number){ return number * number * number;}
char getLetter(double n) {if(n>50) {return'0';} return 'X'}
double getThis(int num){return 1.0;}
int main(){
int n1 = 78, n2 = 55;
double vall = 123.56, val2 = 784.59;
cout << getLetter(val1) << "-" << getLetter(val1);
cout << getLetter(val2) << "--" << getThis(val2);
cout << getCube(123) " " << getCube(321) << "\n";
cout << getThis(val1);
return 0;
}
What is Answer:
#include <iostream>
using namespace std;
int getCube(int number) { return number * number * number; }
char getLetter(double n)
{
if (n > 50)
{
return '0';
}
return 'X';
}
double getThis(int num) { return 1.0; }
int main()
{
int n1 = 78, n2 = 55;
double val1 = 123.56, val2 = 784.59;
cout << getLetter(val1) << "-" << getLetter(val1);
cout << getLetter(val2) << "--" << getThis(val2);
cout << getCube(123) << ", " << getCube(321) << "\n";
cout << getThis(val1);
return 0;
}
Comments
Leave a comment