Articles

C++ program to convert paisa to rupees

C++ program to convert paisa to rupees

In this C++ program tutorial our task is to:

  •  Write a C++ program to convert the paisa into rupees.

C++ program to convert the given paisa into rupees

Given below is the C++ program to convert the given paisa into rupees

#include <iostream>
using namespace std;
int main()
{
	int totalPaisa,rupees,paisa;
	cout<<"Enter Total Paisa : ";
	cin>>totalPaisa;
	rupees = totalPaisa / 100;
	paisa = totalPaisa % 100;
	cout<<"Total Paisa = "<<totalPaisa<<endl;
	cout<<"Converted Paisa in Rs = "<<rupees<<"."<<paisa<<endl;
    return 0;
}

OUTPUT :

Enter Total Paisa : 100

Total Paisa = 100
Converted Paisa in Rs = 1.0
 
EXPLANATION:
In the above C++ code :
  • The compilation enter through the main function (here int main()).
  • Three 4 bits memory spaces are created for the three integers.
  • The compiler takes "totalPaisa" as the input.
  • Then the rupees and paisa are calculated. 
  • Then it is displayed as the desired output.

You can see the above code execution and output in codeblocks IDE:

C++ program to convert paisa to rupees

 


CPP Programs

Would you like to see your article here on tutorialsinhand. Join Write4Us program by tutorialsinhand.com

About the Author
Sayantan Bose
A coder who learns from mistakes
Page Views :    Published Date : Jul 24,2020  
Please Share this page

Related Articles

Like every other website we use cookies. By using our site you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Learn more Got it!