Skip to main content

Find The Maximum Element in Array

#include<iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter the no of Inputs :";
cin>>n;
int max=0;
for(int i=0;i<n;i++)
{
int item;
cin>>item;
if(item>max)
{
max=item;
}
}
cout<<"Maximum no is :"<<max;
}

Comments

Popular posts from this blog

Dogs smile

                    Do Dogs Smile??? In the minds of most people, the equivalent of a dog’s smiling is when he is wagging his tail. But there is actually one canine facial expression that comes close to what we mean by smiling in humans. In this expression, slightly opened jaws reveal the dog’s tongue lapping out over his front teeth. Frequently the eyes take on a teardrop shape at the same time, as if being pulled upward slightly at the outer corners. It is a casual expression that is usually seen when the dog is relaxed, playing, or interacting socially, especially with people. The moment any anxiety or stress is introduced, the dog’s mouth closes and you can no longer see the tongue.

LPU Campus video