[A] [B] [C] [D]

Array Declaration General Form:

One-Dimensional

type var_name[size];

Two-Dimensional

type var_name[size][size];

Array Initialization General Form

type-specifier array_name[size]={value-list};

Automatic Counter Loop General Form:

for(initialization;expression;increment)

{

statements;

}

Case Logic Structure Form:

switch (expression)

{

case constant1:
statement;
break;

case constant2:
statement;
break;

default:
statement;

}

Cast General Form:

(type) expression

Comments form:

/* */

//

Conditional General Form:

if(expression)

{

statement;

}

else

{

statement;

}

Function Form:

returnvalue name(parameter)

{

}

Include General Form:

#include <iostream>//For I/O

#include <iomanip>//For manipulatives

#include <fstream>>//For file I/O

#include <string>>//For string class

#include <cstdlib>//For standard C functions

#include <cmath>//For math functions

#include <cctype>//For character type

using namespace std;

Label General Form:

valid_identifier:

Prototype General Form:

return type name (parameter type parameter name, etc);

REPEAT-UNTIL General Form:

do

{

statements;

}while(expression);

Return General Form:

return value;

Type Definition General Form:

typedef name type;

Variable Declaration General Form:

type variable_list;

Variable Initialization General Form:

type variable_name= constant;

WHILE/WHILE-END General Form:

while(expression)

{

statements;

}


Back to the Main Menu