Academic Tutorials



English | French | Portugese | Dutch | Italian
Google

in linea

Domestico Codici sorgente E-Libri Trasferimenti dal sistema centrale verso i satelliti Metterseli in contatto con Circa noi

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
CSS 1.0
CSS 2.0
HLML
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
CVS
Python
Apple Script
PL/SQL Tutorial
SQL Server
PHP
.NET (dotnet)
Microsoft.Net
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
VC++
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Photoshop Tutorial
Gimp Tutorial
Matlab
Gnuplot Programming
GIF Animation Tutorial
Scientific Visualization Tutorial
Graphics
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Weblogic Tutorial
SEO
Web Site Hosting
Domain Name
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Eclipse
J2ME
JBOSS
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Cobol
Assembly Language
Mainframe
Forth Programming
Lisp Programming
Pascal
Delphi
Fortran
OOPs
Data Warehousing
CGI Programming
Emacs Tutorial
Gnome
ILU
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills
Database Tutorials
Oracle
MySQL
Operating System
BSD
Symbian
Unix
Internet
IP-Masquerading
IPC
MIDI
Software Testing
Testing
Firewalls
SAP Module
ERP
ABAP
Business Warehousing
SAP Basis
Material Management
Sales & Distribution
Human Resource
Netweaver
Customer Relationship Management
Production and Planning
Networking Programming
Corba Tutorial
Networking Tutorial
Microsoft Office
Microsoft Word
Microsoft Outlook
Microsoft PowerPoint
Microsoft Publisher
Microsoft Excel
Microsoft Front Page
Microsoft InfoPath
Microsoft Access
Accounting
Financial Accounting
Managerial Accounting


Operatori in CPP

Previous Next





Operatori booleani

e: operatore del &&

//suppose that San is tired
bool sanIsTired = true;

//but San doesn't have to wake up early
bool sanMustWakeUpEarly = false;

//will San go to sleep now?
bool bedTime = sanIsTired && sanMustWakeUpEarly;

Che cosa questo pezzo del codice farà? Inizializza le variabili, sanIsTired per allineare e sanMustWakeUpEarly a falso, la terza linea del codice (osservazioni non incluse), determiniamo che il San stia andando dormire se e soltanto se “e„ il funzionamento è allineare -- cioè se gli entrambi input a “e„ il funzionamento sono allineare. In questo caso, il primo input è allineare ed il secondo input è falso. Poiché “e„ richiede entrambi gli input essere allineare nell'ordine per uscita essere allineare, ma uno dell'input è falso, l'uscita diventerà falsa. Così, il bedTime variabile memorizzerà un valore falso.




non: !

“non„ l'operatore è usato disponendo il simbolo„! “, prima del valore booleano.

//suppose that Julie stayed up late
bool julieStayedUpLate = true;

//will Julie be peppy tomorrow?
bool julieIsPeppy = !julieStayedUpLate;

Questo codice illustra “non„ il funzionamento. Alla conclusione del codice, introito julieIsPeppy variabile di volontà un valore opposto di julieStayedUpLate. Se il julieStayedUpLate fosse falso, quindi il julianIsPeppy variabile sarebbe allineare. In questo caso, di fronte a è allineare, in modo da il julieIsPeppy ottiene il valore falso.




Gli operatori aritmetici

Oltre che gli operatori booleani, C++ ha molti operatori aritmetici. Sono elencati qui sotto:

name symbol sample usage
addition + int sum = 4 + 7
subtraction - float difference = 18.55 - 14.21
multiplication * float product = 5 * 3.5
division / int quotient = 14 / 3
modulo ("mod") % int remainder = 10 % 6

Questi operatori probabilmente osservano al corrente di un'eccezione dell'operatore del MOD (%). Il MOD è semplicemente un resto prodotto dividendo i due numeri interi. Nell'esempio indicato nella tabella qui sopra, se trattiamo i 10/6 come il divison di numero intero, il quoziente è 1 (piuttosto che che è 1.666) ed il resto è 4. Quindi, un resto variabile otterrà un valore 4.




Operatori di uguaglianza

Un operatore di uguaglianza è usato alle prove che la circostanza come “è di meno che„, “è più grande di„ e “è uguale a„. è utile a confrontare due numeri usando le espressioni come “x<y„.

name symbol sample usage result
is less than < bool result = (4 < 7) true
is greater than > bool result = (3.1 > 3.1) false
is equal to == bool result = (11 == 8) false
is less than or equal to <= bool result = (41.1 <= 42) true
is greater than or equal to >= bool result = (41.1 >= 42) false
is not equal to != bool result = (12 != 12) false

Una volta che usando l'operatore di uguaglianza è conosciuto, è facile da usare tutti gli altri. Tutti funzioneranno nello stesso senso: prendono le espressioni dall'il uno o il altro lato di loro e la volontà restituisce allineare o falso.




Gli operatori di assegnazione

Nel caso degli operatori di assegnazione un valore di ritorno è semplicemente il valore che è memorizzato in una variabile sul di sinistra-mano-lato.

int x;
int y;
x = 5;
y = 9;
cout << "The value of 'x' is "<< x << endl;
cout << "The value of 'y' is " << y << endl;
int sum;
sum = x + y;
cout << "The sum of 'x' and 'y' is " << sum << endl;

Questo blocco del codice mostra perchè uno potrebbe desiderare gettare il valore di ritorno dell'operatore. Guardare la terza linea, x = 5. Stiamo usando un operatore di assegnazione qui per disporre un valore 5 in un X. variabile. Poiché i ritorni di espressioni x = 5 il valore e noi non stanno usandolo, allora potete dire che stiamo ignorando un valore di ritorno.




Che cosa è una precedenza di operatore?

Una precedenza di operatore si riferisce ad un ordine in cui gli operatori sono risolti. Un operatore con un'alta precedenza sarà usato prima dell'operatore con la precedenza più bassa. Qui è un esempio: gli operatori hanno stessa precedenza degli altri operatori nel loro gruppo ed hanno l'più alta precedenza che gli operatori nei gruppi più bassi.

operator name
! boolean not

* multiplication
/ division
% mod

+ addition
- subtraction

< is less than
<= is less than or equal to
> is greater than
>= is greater than or equal to

== is equal to
!= is not equal to

&& boolean and

|| boolean or

= assignment
*= multiply and assign
/= divide and assign
%= mod and assign
+= add and assign
-= subtract and assign




Previous Next

Keywords Operators in CPP, c++ operators, java operators, operators in c++, cpp tutorial, operators in c#, functions cpp, cpp c++, cpp array, bitwise operators, bit operators, array operators, cpp example, cpp code, cpp program, logical operators, cpp function, algorithm cpp, arithmetic operators, operators xor, cpp source, shift operators, cpp h


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
CSS 1.0 Quiz
CSS 2.0 Quiz
HLML Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
CVS Quiz
Python Quiz
Apple Script Quiz
PL/SQL Quiz
SQL Server Quiz
PHP Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
VC++ Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Photoshop Quiz
Gimp Quiz
Matlab Quiz
Gnuplot Programming Quiz
GIF Animation Quiz
Scientific Visualization Quiz
Graphics Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Weblogic Quiz
SEO Quiz
Web Site Hosting Quiz
Domain Name Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Eclipse Quiz
J2ME Quiz
JBOSS Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Cobol Quiz
Assembly Language Quiz
Mainframe Quiz
Forth Programming Quiz
Lisp Programming Quiz
Pascal Quiz
Delphi Quiz
Fortran Quiz
OOPs Quiz
Data Warehousing Quiz
CGI Programming Quiz
Emacs Quiz
Gnome Quiz
ILU Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz
Database Quizes
Oracle Quiz
MySQL Quiz
Operating System Quizes
BSD Quiz
Symbian Quiz
Unix Quiz
Internet Quiz
IP-Masquerading Quiz
IPC Quiz
MIDI Quiz
Software Testing Quizes
Testing Quiz
Firewalls Quiz
SAP Module Quizes
ERP Quiz
ABAP Quiz
Business Warehousing Quiz
SAP Basis Quiz
Material Management Quiz
Sales & Distribution Quiz
Human Resource Quiz
Netweaver Quiz
Customer Relationship Management Quiz
Production and Planning Quiz
Networking Programming Quizes
Corba Quiz
Networking Quiz
Microsoft Office Quizes
Microsoft Word Quiz
Microsoft Outlook Quiz
Microsoft PowerPoint Quiz
Microsoft Publisher Quiz
Microsoft Excel Quiz
Microsoft Front Page Quiz
Microsoft InfoPath Quiz
Microsoft Access Quiz
Accounting Quizes
Financial Accounting Quiz
Managerial Accounting Quiz

Privacy Policy
Copyright © 2003-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved.