Created
January 23, 2014 18:01
-
-
Save saninb/8583581 to your computer and use it in GitHub Desktop.
c++ rekurzija
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
void rekurzija(int argument); | |
void main() | |
{ | |
int broj = 0; | |
do | |
{ | |
cout << "Unesite broj od 1 do 10 !" << endl; | |
cin >> broj; | |
} while (broj<1 || broj>10); | |
rekurzija(broj); | |
system("pause"); | |
} | |
void rekurzija(int argument) | |
{ | |
if (argument>0) | |
{ | |
cout << "Trenutna vrijednost argumenta je: " << argument << endl; | |
argument--; | |
rekurzija(argument); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment