C++ Tutorial 2, Input and Variables

This is the tutorial where we really get into programming. Input and variables are the essence of programming. In this tutorial you will learn how to get data from the user and use variables. You will learn the types of variables there are and how to do basic math with them. At first, this may seem boring and pointless, but you have to learn it, and it should go quick.

Basic Input
When you are making a console application, here is how you should get user input. Some of you may have guessed it, you use c[b]in[/b], of course, the 'c' meaning console and the 'in' meaning input, like 'cout'. So, here is a basic code, where the name of the variable x. cin>>x;

Defining Variables
A variable is what you guessed, a number or piece of data that will vary.

The diffrent types of variables:

bool - true or false
int - whole numbers
char - character (a, b, c, etc...)
string - multiple characters (words, etc..)
float,double - numbers that can have decimals

When deciding what type of variable to use, think about what kind of data it is going to be storing and remember that some data types use more memory than others, however most of your applications will use less memory than you have. To declare a variable, write the type of variable, then the name.

Examples:
int myInt = 7;
char thisChar= 'a', otherChar = 'b', char newChar;
string password= "password";

Syntaxes
Notice how I always had the first word not capatalized, but I capatalized all the other ones. You can also define more than one at a time, and you dont always need to set the value in the begining. Also, when you use a char, use a ' and for a string a ". Try to give your variables meaningful names.

Math
This is really the heart of programming, math! For now, we are going to be doing some simple arithmetic.

The basic math functions are:

+ = addition
- = subtraction
/ = division
* = multiplication

There are a bunch more, but that is all we need for now.

Go out and make a program!

Now that you know some of that basic stuff, try making a program, and dont be afraid to ask for help on http://www.syschat.com!

Chris Silop - http://www.syschat.com!, Computer Forum

weekly home cleaning Arlington Heights ...
In The News:

Jevon Martinez livestreamed himself removing 10 Flock Safety cameras in Bernalillo County, but authorities say eight belonged to neighborhood associations.
A dark web service called Nexus claimed to hold over 153 million driver's license records, and the FBI confirms it is now looking into the incident.
Asking Siri to call American Express connected an 82-year-old woman to a bogus number that nearly drained $100,000 from her Bank of America account.
The Fox News AI Newsletter covers the latest artificial intelligence technology advancements, including the challenges and opportunities AI presents now and for the future.
iPhone Duo opens to a 7.6-inch foldable display starting at $1,999, but Siri Recap's ambient listening on Apple Watch may spark privacy concerns.
Homeowners association meeting minutes and membership lists can expose names, addresses and emails that scammers use to craft convincing phishing scams.
Lima, Ohio, has installed 3,120 floating solar panels on its Twin Lakes Reservoir, projecting nearly $10 million in electricity cost savings.
Amazon's Alexa for Shopping now lets customers verify suspicious emails, texts and phone calls against the company's own communication records.
Lindsey Brooke Isaacs spent 13 days in jail after a Flock camera flagged her Dodge Durango near a fatal Florida crash that killed three people.
AI-powered smart grocery carts are linked to 32% higher spending, according to new research, as Instacart Caper Carts expand across U.S. stores.
A VPN encrypts your connection on hotel, airport and café Wi-Fi abroad, but streaming catalogs and live sports access still depend on provider rules.
Gmail's Verified Sender Program launches September 8, 2026, giving U.S. political committees a more reliable path to your personal email inbox.
Elroy Air's Chaparral can carry over 500 pounds and fly 450 miles without a runway, and the FAA just tested it under a new federal program.
Bedrock Robotics says its autonomous excavators are doing paid earthwork on active job sites in Texas and Nevada with no operator in the cab.
A dedicated banking computer isolates your financial accounts from malware and phishing, but passwords, SIM swapping and outdated software remain risks.
The OlloNi SS1 AI robot pet uses a 4K camera and facial recognition to learn your family, but its removable Red Heart memory module raises questions.
Nine identity theft warning signs range from unfamiliar credit inquiries to SIM swap attacks that can quietly drain your bank account funds.
Robot.com's R-dog uses articulated legs and wheels to climb stairs and deliver packages, while its built-in screens display paid ads along the route.
MyChart phishing emails mimic real patient portal alerts with fake lab results and malware tricks that target Windows users across the country.
The Fox News AI Newsletter covers the latest artificial intelligence technology advancements, including the challenges and opportunities AI presents now and for the future.
Google's Motion Assist places animated dots on Pixel screens to combat motion sickness in vehicles, but the Android 17 rollout remains limited.
Moving to a 55+ community can quickly expose your data to scammers and data brokers before you even unpack, putting your whole family at risk.
Amazon Prime Air drone delivery plans to reach nearly 500 U.S. cities by the end of 2026, but your yard and ZIP code may determine eligibility.
The FBI reports nearly $21 billion in cybercrime losses for 2025, up 26%, as AI scams make fake voices and identities more convincing than ever.
Uber teen accounts now feature live video streaming from the driver's camera, but encrypted recordings stay on Uber's servers for up to 14 days.

10 Ways to Learn a Software

Following tips help you to learn a software in lesser... Read More

Groupware: Answers the 5 Questions of Document Collaboration

Every organization which creates collaborative documents, whether they are budgets,... Read More

Microsoft C# vs. VB.Net

Hi, Guys,I believe a lot of programmers are trying to... Read More

Should I Use Windows Update?

Should one use Windows Update?This topic has good and valid... Read More

Microsoft Great Plains Implementation ? Overview for IT Director/Controller

What is installation in the language of technology? Installation... Read More

Microsoft Great Plains Chemicals & Paint Industry Implementation & Customization Notes

Microsoft Great Plains fits to majority of industries, in the... Read More

Seven Reasons Why a Hosted Inventory Management Solution Might Be Right For Your Organization

Upgrading. Downtime. Maintenance. Hardware obsolescence. Implementation issues. The litany of... Read More

OLAP, An Alternative Technology Over Spreadsheets

Are Spreadsheets Robbing your Enterprise of Competitive Advantage?'90% of "average"... Read More

The Religion And Philosophy Of Small Internet Business

I have always had a tendency to focus on the... Read More

Importance of Coding Standards

Programming Help for BeginnersWe write programs to instruct computers. When... Read More

Microsoft Great Plains Multicurrency ? Overview For Implementation Consultant

When you first think about multicurrency ? you probably have... Read More

Microsoft Small Business Manager eCommerce ? Overview

Microsoft Business Solutions Small Business Manager is scaled down Great... Read More

Causes of ERP Failures

ERP is the acronym of Enterprise Resource Planning. Multi-module ERP... Read More

Microsoft CRM Implementation for Large Corporation ? overview

Microsoft Business Solutions CRM is now approaching the phase of... Read More

What Stands Behind The Software Description?

With thousands of web pages added to the Net every... Read More

Microsoft CRM for Corporate Business ? Working Offline

If your company has regional and worldwide operations, you might... Read More

Microsoft Great Plains: exchange & brokerage ? implementation notes

If you company is small or mid-size special products or... Read More

RFID: Strengthen the Position for SAP; United States

SAP Inc., a global leader in client/server enterprise application software... Read More

Fleet Maintenance Software Reviews

Innovative Maintenance Systems (IMS) is one company that offers solutions... Read More

Software Process Improvement -A Successful Journey

Background: For many organizations like ours, the interim target of... Read More

Hubris - Definition: Microsofts Passport

Before September of 1995, Microsoft ignored the Internet because their... Read More

What to Do if All Screensavers Fun is Grayed Out?

Finally, you have some time to personalize your desktop with... Read More

Microsoft Navision Customization Upgrade ? Tips For Programmer/IT Specialist

Currently Microsoft Business Solutions is on the way of creating... Read More

Who Is Minding Your Sensitive Data?

Stealing company information used to be the specialty of spies... Read More

Navision Attain C/ODBC Crystal Report ? Customization Example

Microsoft Business Solutions Navision is main ERP application for European,... Read More

expert residential cleaners Morton Grove ...