- first code
#include <studio.h>
int main() {
std::cout << "apple" << endl << "banana";
}
- second code
#include <iostream>
using namespace std;
int main(void) {
cout << "apple" << endl;
cout << "banana" << endl;
}
Why am i wrong? i know the answer is second one, But i want to know the why my first code is wrong. Please help me!

This first code is wrong because
#include <studio.h>is the wrong header file. The correct header file forstd::coutandstd::endlis#include <iostream>.It's also wrong because
endlis in thestd::namespace. So even with the correct header file it should bestd::endl