Access over 35 million academic & study documents

32 Write a complete program that has a function named findRemainder

Content type
User Generated
Showing Page:
1/2
32.Write a complete program that has a function named
findRemainder that takes in 2 pass-by-value parameters of
type int and one pass-by-reference parameter of type int.
findRemainder will return nothing and, instead, use the
reference parameter to store the result of finding the
remainder when the first parameter is divided by the
second. Main should call the function and output the result
to the screen.
#include <iostream>
using namespace std;
Solution
#include<iostream>
using namespace std;
void findRemainder(int a,int b,int *c){
*c = a%b;
}
int main(){
int a,b,c;
cout<<\"Enter a and b\"<<endl;
cin>>a>>b;
findRemainder(a,b,&c);

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/2

Sign up to view the full document!

lock_open Sign Up
Unformatted Attachment Preview
32.Write a complete program that has a function named findRemainder that takes in 2 pass -by-value parameters of type int and one pass-by-reference parameter of type int. findRemainder will return nothing and, instead, use the reference parameter to store the result of finding the remainder when the first parameter is divided by the second. Main should call the function and output the result to the screen. #include using namespace std; Solution #include using namespace std; void findRemainder(int a,int b,int *c){ *c = a%b; } int main(){ int a,b,c; cout ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4