Code: Show/Hide /*my first program after not pragraming for a year
ShellExecute(NULL, "open", "http://a3studio.4t.com", NULL, NULL, SW_SHOWNORMAL); this command brings u to this website */ #include <iostream> #include <stdlib.h> #include <windows.h> using namespace std; #define PI 3.14 //defines pi so pie now = to 3.14 int main() { SetConsoleTitle("Mini Calculator"); // title SetCursorPos(0,0); //cursor position HANDLE text; //handle variable text = GetStdHandle(STD_OUTPUT_HANDLE); //make it that SetConsoleTextAttribute(text,FOREGROUND_GREEN); //text attribute menu: int choice; cout<<"Welcome to MiniCalculator \n\n"; cout<<"Type in 1 and press enter to add"<<endl; cout<<"Type in 2 and press enter to subtract"<<endl; cout<<"Type in 3 and press enter to multiply"<<endl; cout<<"Type in 4 and press enter to divide"<<endl; cout<<"Type in 5 and press enter to find area/perimiter of a circle"<<endl; cout<<"Type in 6 and press enter to go to google.com"<<endl; cout<<"Type in 7 and press enter to exit"<<endl; cout<<"Type in your choice and press enter: "; cin>>choice; switch (choice){ case 1: int a; int b; int c; c = a + b; cout<<"\n\n Type in and press enter the number you want to add to: "; cin>>a; cout<<"\n\n Now type in and press enter the number you want to add: "; cin>>b; cout<<"The Result is "<<c<<".\n\n\n\n"; system("pause"); cout<<"n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; goto menu; } return 0; } [quote][/quote] |
Code: Show/Hide c = 5;
c=10; cout << c; |
Quote: |
cout<<"n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; |