int,
double, if, for, .....)int, double, float, char, if, for, while,
.... You will learn more.(1) a (2) a2 (3)abc (4) nbc4 (5) 2go
(6) _abc (7) score (8)myFirstHomeworkScroe (9) a2b3c (10)A_2_B_3
(11) 1010 (12) 3X (13) %change (14) change% (15) data-1
(16)int (17) www.ucla.edu (18) program.cpp (19) ucla_edu
rate RATE Rate
score, income,
renttopSpeed, highestScore, taxRate, timeOfArrival
cin, cout, main
....
#include<iostream> |
#include<iostream> |
int, double, float etc etc)int numOfStudents;
double percentage;
SyntaxType_name variable_name_1, variable_name_2,......;Exampleint numOfQuarters, numOfDimes, numOfNickels; |
| Type Name |
Meaning |
Memory Used |
|---|---|---|
short |
small integer |
2 bytes |
int |
integer |
4 bytes |
long |
large integer |
4 bytes |
float |
decimal number |
4 bytes |
double |
decimal number (more precious) |
8 bytes |
long double |
decimal number (most precious) |
10 bytes |
char |
characters |
1 byte |
bool |
true/false |
1 byte |
#include<iostream> |
double.
SyntaxVariable = Expression;Exampledistance = rate * time; |
|
a has not been given a valueathe output of the program is a strange number
SyntaxType_Name Variable_Name_1 = Expression_for_Value_1, Variable_Name_2 = Expression_for_value_2, ....;Examplesint count = 0, limit = 10;or SyntaxType_Name Variable_Name_1(Expression_for_Value_1), Variable_Name_2 (Expression_for_value_2), ....;Examplesint count(0), limit(10); |
#include<iostream> |
int a = 2.55 ?