CyberCodes
Sum, Difference, Product and Qoutient in C++ Welcome

Reminders sa mga rehistradong myembro:

•ang lengwahe na gagamitin ay pawang english at tagalog lamang

•Bawal po dito ang pakikipag away

•Bawal ang mga shorcut na mga words
Example: txt, Pwd, at iba pa

•Bawal mababastos at masasakit na salita o anu mang makakasakit
ng damdamin ng isang myembro ng forum na ito

•use the "like" button if the post of the following user you think are usefull



Join the forum, it's quick and easy

CyberCodes
Sum, Difference, Product and Qoutient in C++ Welcome

Reminders sa mga rehistradong myembro:

•ang lengwahe na gagamitin ay pawang english at tagalog lamang

•Bawal po dito ang pakikipag away

•Bawal ang mga shorcut na mga words
Example: txt, Pwd, at iba pa

•Bawal mababastos at masasakit na salita o anu mang makakasakit
ng damdamin ng isang myembro ng forum na ito

•use the "like" button if the post of the following user you think are usefull

CyberCodes
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Sum, Difference, Product and Qoutient in C++

Go down

Sum, Difference, Product and Qoutient in C++ Empty Sum, Difference, Product and Qoutient in C++

Post by princeterror Fri Jan 11, 2013 11:28 pm

Output:

Enter a high number:
Enter a low number:

"The sum of two numbers is ___________"
"The difference of two numbers is ______"
"The product of two numbers is ________"
"The Qoutient of two numbers is _______"
"The two numbers are _____ and ______"


Answer Codes
Code:
# include <iostream>

using namespace std;

int main()
{
    int a,b;
    cout<<"Enter a high number: ";
    cin>>a;
    cout<<"Enter a low number: ";
    cin>>b;
    cout<<endl;

    cout<<"the sum of the two numbers is "<<a+b<<endl;
    cout<<"The difference of the two numbers is "<<a-b<<endl;
    cout<<"The product of the two numbers is "<<a*b<<endl;
    cout<<"The qoutient of the two numbers is "<<a/b<<endl;
    cout<<"The two numbers are "<<a<<" and "<<b<<endl<<endl;

//system("pause");
return 0;
}


kung gusto nyu naman may mga kulay ang mga titik try nyu to


With Font color:
Code:
# include <iostream>
# include <windows.h>
using namespace std;



int main()
{


    int a,b;
    HANDLE  hConsole;
  hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
  SetConsoleTextAttribute(hConsole, 2);
    cout<<"Enter a high number: ";


  SetConsoleTextAttribute(hConsole, 3);
    cin>>a;

  SetConsoleTextAttribute(hConsole, 2);
    cout<<"Enter a low number: ";

  SetConsoleTextAttribute(hConsole, 3);
    cin>>b;
    system("cls");

    cout<<endl<<endl;
    SetConsoleTextAttribute(hConsole, 2);
    cout<<"the sum of the two numbers is ";
    SetConsoleTextAttribute(hConsole, 3);
    cout<<a+b<<endl;
    SetConsoleTextAttribute(hConsole, 2);
    cout<<"The difference of the two numbers is ";
    SetConsoleTextAttribute(hConsole, 3);
    cout<<a-b<<endl;
    SetConsoleTextAttribute(hConsole, 2);
    cout<<"The product of the two numbers is ";
    SetConsoleTextAttribute(hConsole, 3);
    cout<<a*b<<endl;
    SetConsoleTextAttribute(hConsole, 2);
    cout<<"The qoutient of the two numbers is ";
    SetConsoleTextAttribute(hConsole, 3);
    cout<<a/b<<endl;
    SetConsoleTextAttribute(hConsole, 2);
    cout<<"The two numbers are ";
    SetConsoleTextAttribute(hConsole, 3);
    cout<<a;
    SetConsoleTextAttribute(hConsole, 2);
    cout<<" and ";
    SetConsoleTextAttribute(hConsole, 3);
    cout<<b<<endl<<endl;

//system("pause");
return 0;
}
princeterror
princeterror
Universal Moderator
Universal Moderator

Posts : 272
Credits : 11465
Fame : 81
Join date : 2012-06-07
Age : 32

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum