// C++ Syntax Overview Example
#include
#include
using namespace std;
// Function declaration
int add(int a, int b) {
return a + b;
}
// Class declaration
class Car {
public:
string brand;
int year;
Car(string b, int y) {
brand = b;
year = y;
}
void honk() {
cout 18) {
cout
#include
using namespace std;
// Function declaration
int add(int a, int b) {
return a + b;
}
// Class declaration
class Car {
public:
string brand;
int year;
Car(string b, int y) {
brand = b;
year = y;
}
void honk() {
cout 18) {
cout
#include
using namespace std;
// Function declaration
int add(int a, int b) {
return a + b;
}
// Class declaration
class Car {
public:
string brand;
int year;
Car(string b, int y) {
brand = b;
year = y;
}
void honk() {
cout 18) {
cout
#include
using namespace std;
// Function declaration
int add(int a, int b) {
return a + b;
}
// Class declaration
class Car {
public:
string brand;
int year;
Car(string b, int y) {
brand = b;
year = y;
}
void honk() {
cout 18) {
cout
#include
using namespace std;
// Function declaration
int add(int a, int b) {
return a + b;
}
// Class declaration
class Car {
public:
string brand;
int year;
Car(string b, int y) {
brand = b;
year = y;
}
void honk() {
cout 18) {
cout
#include
using namespace std;
// Function declaration
int add(int a, int b) {
return a + b;
}
// Class declaration
class Car {
public:
string brand;
int year;
Car(string b, int y) {
brand = b;
year = y;
}
void honk() {
cout 18) {
cout
#include
using namespace std;
// Function declaration
int add(int a, int b) {
return a + b;
}
// Class declaration
class Car {
public:
string brand;
int year;
Car(string b, int y) {
brand = b;
year = y;
}
void honk() {
cout 18) {
cout << "Adult" << endl;
} else {
cout << "Minor" << endl;
}
// Loops
for (int i = 0; i < 5; i++) {
cout << i << " ";
}
cout << endl;
// Function call
int result = add(5, 3);
cout << "Sum: " << result << endl;
// Object creation
Car myCar("Chevrolet", 2020);
myCar.honk();
return 0;
}