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

tidy up service Northbrook ..
In The News:

ETA sharing on Apple Maps and Google Maps keeps contacts updated automatically while you drive safely. Learn step-by-step instructions for iPhone and Android.
Data removal from brokers protects against AI-powered scams and deepfake threats in 2026. Learn how data brokers sell your personal information to scammers.
Learn how to act against cybercriminals in 2026 with essential security steps like two-factor authentication, software updates and credit freezing.
Choose between OpenAI releasing Sora text-to-video model, the AI race heating up, or Waymo driverless cars launching in cities across the country
Learn how to set up Google Maps and Apple Maps on your phone to automatically remember where you parked. Step-by-step instructions for enabling location services and parking detection.
Phishing scammers use rnicrosoft.com domain to impersonate Microsoft by replacing "m" with "rn" in typosquatting attacks that steal login credentials.
OpenAI announces new teen safety rules for ChatGPT users under 18, blocking romantic roleplay and requiring extra caution on body image topics.
A 2025 data breach at fintech company 700Credit exposes personal information of more than 5.8 million people through compromised third-party integration partner.
Retailers lose $76.5 billion annually to return fraud as nearly 10% of U.S. retail returns involve fraudulent activity, with $850 billion in returns expected in 2025.
ShinyHunters claims responsibility for stealing 94GB of Pornhub user data affecting over 200 million records and demands Bitcoin ransom.
ChatGPT 2025 now connects to Apple Music, Canva, Expedia, TripAdvisor and OpenTable through built-in apps that help users create playlists, design graphics and more.
Apple releases emergency patches for two zero-day vulnerabilities actively exploited in attacks. iPhone and iPad users urged to update immediately.
DoorDash launches Zesty, an AI-powered social app that recommends restaurants through conversational search, now testing in San Francisco and New York.
Cybersecurity firm Infoblox reveals that over 90 percent of parked domains now redirect visitors to scams and malware, making simple typos extremely dangerous.
The Fox News AI Newsletter covers the latest artificial intelligence technology advancements, including the challenges and opportunities AI presents now and for the future.
GPT-5.2 is now live for all ChatGPT users with improved coding, writing and image interpretation, with Kurt Knutsson offering his review.
New iPhone replacement scam uses pressure tactics and fake carrier calls to steal devices from buyers. Criminals claim shipping errors and demand urgent returns.
Amazon Ring's new facial recognition feature sparks privacy controversy as Electronic Frontier Foundation critics argue the AI upgrade expands surveillance risks.
New Android banking trojan Sturnus steals credentials, reads encrypted messages and controls devices.
Denmark's 3D-printed student village proves automation builds 36 apartments faster than traditional methods. Skovsporet project shows housing future.
Discover Android's new Sound Notifications feature that alerts you to smoke alarms, doorbells, and baby cries even when wearing headphones.
New SantaStealer malware reportedly threatens holiday shoppers with password theft. This Christmas-themed info-stealer targets browsers and crypto wallets.
The Christmas season brings a surge in Netflix phishing scams targeting shoppers with fake emails. Stacey P received convincing scam but verified account first.
San Francisco Giants invite Jamie Grohsong to throw ceremonial first pitch at Oracle Park after he learned to play baseball with a bionic hand following an injury.
FBI warns cybercriminals are stealing family photos from social media to create fake proof of life images in virtual kidnapping scams targeting victims.

How To Identify, Cure and Prevent Spyware/Adware Infections

Just when you thought you were Web savvy, one more... Read More

How to Evaluate Staffing Software

If you are in the market for new staffing software,... Read More

Great Plains Accounting Migration to Microsoft Great Plains - Overview for IT Specialist

This is a short article, written in question/answer/FAQ style to... Read More

Microsoft Small Business Manager Customization Options - Overview

Microsoft Business Solutions Small Business Manager is Great Plains Dexterity... Read More

Cisco Certification: Introduction To ISDN, Part IV

In part III of this ISDN primer, we learned that... Read More

Microsoft Office Selecting Secrets

Stop the Runaway MouseWhat's the "runaway mouse?" You've seen it...you... Read More

Making The Decision To Automate Your Software Testing

Not every software testing project can or should be automated.... Read More

Microsoft Great Plains ? Licensing & Product Versions

Current Microsoft Business Solutions Great Plains has more that 10... Read More

The Top 5 Wrong Reasons For Not Hiring Testers

Considering whether or not your software company should hire a... Read More

Microsoft CRM USA Nationwide Remote Support

Remember old good days when your company probably had Great... Read More

.NET :Solving the Multiple Inheritance Issue Under .NET Platform

.NET platform does not support multiple inheritance. Do not confuse... Read More

Managing Stress in the Computer Industry - Five Steps to a Stress-free Life

It would be easy to think, like most people apparently... Read More

Microsoft Great Plains Subcontracting ? Overview for Microsoft Business Solutions Partner

Microsoft Business Solutions Great Plains is very popular ERP/MRP applications... Read More

Microsoft Great Plains implementation: Restaurants Supply Chain Management Example

Microsoft Great Plains serves majority of US based horizontal and... Read More

Windows x: Basic Windows ?Security? Issues

Language development computer: Computer-based method for aiding language development seems... Read More

Microsoft Great Plains Customization Recovery & Upgrade for Large Corporation

At the end of XX century, in the late 1990th... Read More

Microsoft Great Plains Upgrade ? Version 8.0 Overview for IT Director/Controller

If you have Microsoft Great Plains as main accounting and... Read More

Create ASP in Minutes

DBxtra goes ASPGetting to the information hidden within corporate databases... Read More

Software Engineering: An Introduction

Software Engineering is the Systematic Approach for analysis design implementation... Read More

HSphere Control Panel Tips and Tricks - Power At Your Fingertips: Part 1

The first topic we are going to discuss... Read More

Linux ? Keyboard Or Mouse

Just stress testing one of the latest Linux distributions. Been... Read More

Navision Attain Database access via C/ODBC in ASP.NET Application

Navision Software was purchased by Microsoft and now it is... Read More

Keeping Track

One of the things we can be as certain of... Read More

Microsoft Great Plains as ERP and Microsoft CRM as CRM

If you have Microsoft Great Plains and support it for... Read More

Microsoft CRM Implementation & Customization: MS CRM Fax Gateway

With this small article we are continuing Microsoft Business Solutions... Read More

reliable home cleaners Buffalo Grove ..