Article
The Basics of a C++ Program
PDF
1 vue
0 téléchargement
Résumé
Basic Elements of C++
Lecture recommandée Cours alignement conventionnel Cours alignement conventionnel en PDF, plus de 30 000 cours électromécanique gratuit, exercices gratuit, rapports pfe, l... Electromécanique Lire The Basics of a C++ ProgramA C++ program is a collection of one or more subprograms (functions)
Function
Collection of statements
Statements accomplish a task
Every C++ program has a function called main
Example Program
#include
using namespace std;
int main()
{
cout<<"Welcome to C++ Programming"<<endl;
return 0;
}
The Basics of a C++ Program
Programming language
a set of rules, symbols, special words
Rules
syntax – specifies legal instructions
Symbols
special symbols ( + - * ! … )
Word symbols
reserved words
(int, float, double, char …)
Identifiers
Rules for identifiers
must begin with letter or the underscore _
followed by any combination of numerals or letters
recommend meaningful identifiers
Evaluate the following
ElectricCharge
23Skidoo
snarFbLat
Arithmetic Operators and Operator Precedence
Common operators for calculations+ - * / %
Precedence same as in algebraic usage
Inside parentheses done first
Next * / % from left to right
Then + and - from left to right
Informations
- Format
- Domaine
- Cours C/C++
- Publié le
- 2 avr. 2022
- Vues
- 1
Ressources liées
Cours C/C++
Le langage C++ Travaux Pratiques
PDF · 102 p.
Vues :4
Téléchargements :1
Taille :293 Ko
18 févr. 2024
Commentaires (0)
Connectez-vous pour laisser un commentaire.
Soyez le premier à commenter
Partagez votre avis sur ce document — questions, retours ou votre propre expérience.