#include <iostream>
using namespace std;
template <typename T>
void min(T n1,T n2,T n3)
{
if(n1<n2)
{
if(n1<n3)
cout<<n1;
else
cout<<n3;
}
else if(n2<n3)
cout<<n2;
else
cout<<n3;
}
int main() {
float a,b,c;
cin>>a>>b>>c;
min(a,b,c);
return 0;
}
using namespace std;
template <typename T>
void min(T n1,T n2,T n3)
{
if(n1<n2)
{
if(n1<n3)
cout<<n1;
else
cout<<n3;
}
else if(n2<n3)
cout<<n2;
else
cout<<n3;
}
int main() {
float a,b,c;
cin>>a>>b>>c;
min(a,b,c);
return 0;
}
this program is not evaluating... its showing 0%
ReplyDeleteReplace template with template
ReplyDeleteIt will work with 100% success.
bro template with template ??
DeleteYES
DeleteThis comment has been removed by the author.
Deletetemplate T with class T
Deletereplace typename with class
ReplyDeletecorrect
Deletecorrect
Delete
ReplyDelete// Working code
#include //iostream
using namespace std;
template
void min(T n1,T n2,T n3)
{
if(n1>a>>b>>c;
min(a,b,c);
return 0;
}
#include
Deleteusing namespace std;
template
void min(T n1,T n2,T n3)
{
if(n1>a>>b>>c;
min(a,b,c);
return 0;
}
https://paiza.io/projects/TjPO_OeensAAqusf42Cs6g?language=cpp Code works here.
Delete#include
ReplyDeleteusing namespace std;
template
void min(T n1,T n2,T n3)
{
if(n1>a>>b>>c;
min(a,b,c);
return 0;
}
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDelete100 percent
ReplyDeleteThis comment has been removed by the author.
Delete#include
ReplyDeleteusing namespace std;
template
void min(T n1,T n2,T n3)
{
if(n1>a>>b>>c;
min(a,b,c);
return 0;
}