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:
Would you like to see your article here on tutorialsinhand.
Join
Write4Us program by tutorialsinhand.com
About the Author
Sayantan Bose
- š Iām currently working on DS Algo skills
- š± Iām currently learning web develeopement
- šÆ Iām looking to collaborate with Oppia
- š« Reach me at https://www.linkedin.com/in/sayantan-bose-14134a1a6/
- š Pronouns: his/him
Page Views :
Published Date :
Jul 24,2020