BIT MANIPULATION SE HOGA 

using namespace std;
#include<iostream>
int getint a  , int pos)
{
    return (( a & ( 1 << pos))!=0);
}
int setint a , int pos)
{
    return a | ( 1<<pos);
}
void ank ( int array[] , int a )
{
    int res=0 ;
    forint i =0 ; i<4i++)
    {
        int c=0; // I DID A MISTAKE THAT I INITILIZED THIS FROM THERE 
                            BUT IT SHOULD BE ZERO AGAIN AND AGAIN .... 
        forint j =0 ; j<a ;j++)   // 1 ,1, 1, 4, 2  ,2  ,2  , 3 ,3 ,3 
        {
            if(getarray[j] , i))
            {
                c++;
            }
        }
        cout<<c<<" "<<endl;
        if(c%3!=0)
        {
             res=setres , i ) ;
        }
    }
    cout<<res;
}
int main()
{
    int array[]=1 ,119 ,3 ,3 ,3  };
    ankarray , 7);
}

 

Comments

Popular posts from this blog