#include
#include
using namespace std;
int main()
{
int no,i=1,n=3;
int largest=INT_MIN;
while(i<=3)
{
cin>>no;
if(largest<no)
{
largest=no;
}
i++;
}
cout<<"The largest number "<<largest;
}
#include
#include
using namespace std;
int main()
{
int no,i=1,n=3;
int largest=INT_MIN;
while(i<=3)
{
cin>>no;
if(largest<no)
{
largest=no;
}
i++;
}
cout<<"The largest number "<<largest;
}
hi @gamingzone123a_2a8bc985f4c429d5 updated
#include <bits/stdc++.h>
using namespace std;
int main()
{
int no,i=1,n=3;
int largest=INT_MIN;
while(i<=3)
{
cin>>no;
if(largest<=no) // <=
{
largest=no;
}
i++;
}
cout<<largest; // dont print that line
}
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
Hello sir i still facing the errors
source.cpp:1:10: error: #include expects “FILENAME” or 1 | #include <bits/stdc++.h> | ^ source.cpp: In function ‘int main()’: source.cpp:6:13: error: ‘INT_MIN’ was not declared in this scope 6 | int largest=INT_MIN; | ^~~~~~~ source.cpp:1:1: note: ‘INT_MIN’ is defined in header ‘’; did you forget to '#include '? +++ |+#include 1 | #include <bits/stdc++.h> source.cpp:8:9: error: ‘lt’ was not declared in this scope 8 | while(i<=3) | ^~ source.cpp:8:11: error: expected ‘)’ before ‘;’ token 8 | while(i<=3) | ~ ^ | ) source.cpp:8:12: error: expected primary-expression before ‘=’ token 8 | while(i<=3) | ^ source.cpp:20:1: error: ‘cout’ was not declared in this scope 20 | cout<<largest; // dont print that line | ^~~~ source.cpp:1:1: note: ‘std::cout’ is defined in header ‘’; did you forget to '#include '? +++ |+#include 1 | #include <bits/stdc++.h> source.cpp:20:6: error: ‘lt’ was not declared in this scope 20 | cout<<largest; // dont print that line | ^~
#include <bits/stdc++.h> is it similar to #include
@gamingzone123a_2a8bc985f4c429d5 It includes all headers, please try submitting the code properly which i gave