disini saya akan membahas bagai mana cara membuat program kalkulator pertama
pertama:
adalah kode untuk membuka program itu kepala program atau header
semoga bermanfaat sharing saya
#include <iostream> using namespace std; int main() {
langsung aja TKP gan besok-besok aja pelajarannya
#include <iostream> using namespace std; int main() { // One and two are the numbers the user selects double one, two; cout << "Please input the first number:"; cin >> one; // Cin takes the users first number, and assosicates it to one cout << "Please input the second number:"; cin >> two; // Here cin takes the second number and assisgns it to two cout << "\nThe answers are:\nAddition:" << one + two; // All the math happens here cout << "\nSubtraction:" << one - two; cout << "\nMultiplication:" << one * two; cout << "\nDivision:" << one / two; cout << "\nThank you for using myCalc."; cout << "\n"; main(); // This starts the main function again, so you can do another calculation system("PAUSE"); return 0; }
{ 0 comments... Views All / Send Comment! }
Post a Comment