Answer to Question #244034 in C++ for ghhuh

Question #244034

Write a full program that find the remainder. Your solution should have a function named findRemainder that accepts two integer parameters and returns the remainder. Your main function should call the findRemainder function and assigns the return value to an int variable named remainder that is declared inside the main function. Your program should then print out the value stored in remainder. Submit the code and a copy of your output.


1
Expert's answer
2021-09-29T01:18:51-0400
#include <iostream>
using namespace std;




int findRemainder(int number1,int number2){
	return number1%number2;
}


int main(){
	int number1;
	int number2;
	cout<<"Enter number 1: ";
	cin>>number1;
	cout<<"Enter number 2: ";
	cin>>number2;




	int remainder=findRemainder(number1,number2);
	cout<<"Remainder: "<<remainder<<"\n\n";


	cin>>number1;
	return 0;


}





Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS