In: Computer Science
Write a function of interest to you. It should that take at least 3 inputs from different types and return at least three different values.
Call your function from the main.
Print the resultant outputs in the main (not in the function).
If you have any doubts, please give me comment...
#include<iostream>
#include<string>
using namespace std;
void readInputs(int &inp1, double &inp2, string &inp3);
int main(){
int inp1;
double inp2;
string inp3;
readInputs(inp1, inp2, inp3);
cout<<"\nEntered data:"<<endl;
cout<<"Input 1: "<<inp1<<endl;
cout<<"Input 2: "<<inp2<<endl;
cout<<"Input 3: "<<inp3<<endl;
return 0;
}
void readInputs(int &inp1, double &inp2, string &inp3){
cout<<"Enter any integer: ";
cin>>inp1;
cout<<"Enter any decimal value: ";
cin>>inp2;
cout<<"Enter a string: ";
cin>>inp3;
}