Thanks for the detailed explanation it really helped me to understand it better so i reconstructed my code and compiled it again so it would be like this,the whole program is not written,but this is the important part i need help on.As you can see i changed using the advice i got but it won't return me to the main function when i say so.
#include <iostream>
#include <cmath>
#include <stdlib.h>
using namespace std;
void Sobiranje()
{
float v_broj,rezultat=0;
system("cls");
cout<<endl;
cout<<" ---------------------------------"<<endl;
cout<<" ***** Marijan's Claculator *****"<<endl;
cout<<" ---------------------------------"<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
float broj,a,broj_nasob;
cout<<"Insert the numbers you would like me to calculate,to return to the main menu press 0 :"<<endl;
while(broj!=0)
{
cin>>v_broj;
if(v_broj!=0) //If the number you insert is not 0
rezultat=rezultat+v_broj;//keep adding them all
else //if it is 0
return; //Get back to the main function to start it all over
cout<<"Rezultatot e :"<<rezultat<<endl;
}
}
int main()
{
int Izbor=0;
cout<<endl;
cout<<" ---------------------------------"<<endl;
cout<<" ***** Marijan's Calculator *****"<<endl;
cout<<" ---------------------------------"<<endl;
cout<<endl;
cout<<endl;
cout<<" *-------------------------------------------------*"<<endl;
cout<<" |1.For addiction of two or more numbers select 1|"<<endl;
cout<<" |2.For subtraction select 2| "<<endl;
cout<<" |3.For multipication select 3|"<<endl;
cout<<" |1.For division select 4|"<<endl;
cout<<" *-------------------------------------------------* "<<endl;
cout<<"Izbor :"<<endl;//Means "choice"
cin>>Izbor;//enter your choice
if(Izbor==1)//if you choose 1
Sobiranje();//run the Sobiranje function(addition)
system("PAUSE");
return 0;
}
And yet it won't return me to the original menu,instead when i press 0,press any key to continue appears.
P.C

orry for being annoying.