lundi 28 novembre 2016

Error showing begin and end "not declared" and i didnt get any reasons regarding that on google

    void lcm2(){
int noe,number;
cout<<"enter the no. of elements whose lcm you want"<<endl;
cin>>noe;
int arg[noe];
long product=1;
for(number=0;number<noe;number++){
   cout<<"enter the "<<number+1<<"element"<<endl;
   cin>>arg[number];
   product*=arg[number];
   }
   int maximumm=arg[0];
   for(number=0;number<noe;number++){
       if(maximumm<arg[number]){
          maximumm=arg[number];
       }
   }
bool result;
result = std::all_of(begin(arg),end(arg),[](int i){return i%2==0;});
   while(maximumm!=product){
        if(result==true){
         cout<<"the lcm of all the numbers entered is = "<<maximumm<<endl;
         break;
         }
         else{
         maximumm++;
    }
    }
    }

HI i am trying to write a code which calculates lcm for multiple numbers and here is the code so the error i am encountering is that the begin and end arnet declared!!! why?? can i know the reason and if you dont mind please tell me the solution to it

Aucun commentaire:

Enregistrer un commentaire