ADVERTISEMENT

One of the works done by our Robotics and Machine Learning division,
SELF-LEVELING QUADCOPTER
Arduino based Quadcopter.
Self-leveling is acheived by the aligning the quadcopter using the readings from the gryo as well as the accelerometer.
A four channel RC transmitter is used to control the movement of the quadcopter when in flight. Kindly subscribe to our YouTube Channel and stay tuned.

Friday 2 September 2016

CSE1002:PP3:Tender scrutiny using refferrence variable


#include<iostream>
using namespace std;
class vendor
{
long r;
string name;
public:
long v;
void read()
{
 cin>>r;
 cin>>name;
 cin>>v;
}
void display()
{
 cout<<r<<endl;
 cout<<name<<endl;
}
};
vendor * search(vendor * V,int n);
vendor * search(vendor * V,int n)
{
 long min=V->v;
 vendor * A;
 A=V;
 for(int i=0;i<n;i++)
 {
  if(min>V->v)
  {
   min=V->v;
   A=V;
  }
  V++;
 }
 return A;
 
}
int main()
{
 int n;
 cin>>n;
 vendor V[n];
 for(int i=0;i<n;i++)
 {
  V[i].read();
 }
 vendor * MINV=search(&V[0],n);
 MINV->display();
 
 
return 0;
}


No comments:

Post a Comment