8.1.. Prebrojati parne prirodne brojeve od 1 do 5.

Listing programa:

//p08112086//
#include <iostream>

using namespace std;

int main()
{
	int i,br;
	br=0;
	for(i=1;i<=5;i++)
	  if (i%2==0)
	    br=br+1;	
	cout<<"Prebrojanih ima: "<<br<<endl;
	system("pause");
	return 0;
}

Ispis na ekranu:

Index