View Code of Problem 68

#include <iostream>
using namespace std;
int main()
{
	int n;
	int min=0;
	int max=0;
	int arr[3];
	for(int i=0;i<3;i++)
	{
		cin>>arr[i]; 
	}
	
	min=a[0];
	max=a[0];
	for(int j=0;j<3;j++)
	{
		if(max<arr[j])
		{
			max=arr[j];
		}
			if(min>arr[j])
		{
			min=arr[j];
		}
	}
	cout<<max;
cout<<min;
	return 0;
}
/*
Main.cc: In function 'int main()':
Main.cc:14:6: error: 'a' was not declared in this scope
  min=a[0];
      ^
Main.cc:5:6: warning: unused variable 'n' [-Wunused-variable]
  int n;
      ^
*/

Double click to view unformatted code.


Back to problem 68