Evaluation:
Published: 28.12.2010.
Language: Latvian
Level: College/University
Literature: 2 units
References: Not used
  • Research Papers 'C++ galvenie operatori', 1.
  • Research Papers 'C++ galvenie operatori', 2.
  • Research Papers 'C++ galvenie operatori', 3.
  • Research Papers 'C++ galvenie operatori', 4.
  • Research Papers 'C++ galvenie operatori', 5.
  • Research Papers 'C++ galvenie operatori', 6.
  • Research Papers 'C++ galvenie operatori', 7.
  • Research Papers 'C++ galvenie operatori', 8.
  • Research Papers 'C++ galvenie operatori', 9.
Table of contents
Nr. Chapter  Page.
  Ievads    4
1.  If...else    5
2.  While    5
3.  For    6
4.  Switch    7
  Izmantotā literatūra    10
Extract

1.If...else

Šis operātors ir loģiskas darbības operātors: ja izpildas šis nosacījums, darīt noteiktās darbības, pārējos gadījumos darīt citas noteiktas darbības. Tā var latviešu valodā definēt if.. else darbību.
Lai šo operātoru izprastu labāk, apskatīsim doto programmu:

#include
using namespace std;
int main()
{
int a;
cout<<"Ievadiet pazitīvu vai negatīvu skaitli:";
cin >>a;
if (a>=0) cout<<"Skaitlis ir pozitīvs";
else
cout<<"Skaitlis ir negatīvs";
system("pause");
return 0;…

Author's comment
Atlants