what is wrong in this problem
#include <iostream> using namespace std; int main() { x; cin >> x; if (x = 404){ cout<< "NOT FOUND"; } else cout<< "FOUND"; return 0; }
Problem Link: 404 Not Found Practice Coding Problem - CodeChef
u havent declared x variable and used x= insted of x==` include using namespace std;
int main() { int x; // Declare and initialize x cin >> x; if (x == 404) { cout << “NOT FOUND”; } else { cout << “FOUND”; } return 0; } this is correct code`
You have to declare x like “int x ;” but you declared it as “x;” , and in the if condition line use “==” double equals to instead of a single equals to , as in programming we have to use “==” to compare two things.