Write a C++ program that accepts an input value in Tambala from the user and
then the program should convert the value to equivalent value in Kwacha and
Tambala.
(For example, if the user enters 112 as input value, the program should display:
1 Kwacha and 12 tambala
#include <iostream>
using namespace std;
int main()
{
int tambala,y;
cout<<"\nEnter value in Tambalas: ";
cin>>tambala;
if(tambala>0){
cout<<tambala/100<<" Kwacha and "<<tambala%100<<" tambala"<<endl;
}
return 0;
}
Comments
Leave a comment