Write a simple c++ class to print the largest number among three numbers. If any one of the input is 0 then print as " Invalid Input". Test Case 1 Input (stdin) 5 6 7 Expected Output 7 Test Case 2 Input (stdin) 100 200 0 Expected Output Invalid Input
#include <iostream>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
if(a!=0 && b!=0 && c!=0)
if(a>c || b>c)
if(a>b)
cout<<a;
else
cout<<b;
else
cout<<c;
else
cout<<"Invalid Input";
return 0;
}