+ 1
Hi.what is the output and why?(c++)
#include<iostream> using namespace std; void main(){ int i = 5; cout << i; }
6 Answers
+ 8
yeah main function should be int and return any value like 0
#include<iostream>
using namespace std;
int main(){
int i = 5;
cout << i;
return 0;
}
+ 7
yeah return 0; is not necessary it will work fine without it too but it is written literally because every function returns an value
+ 2
ohhh! main function can not be void!!!
this is reason of error!!!
+ 1
but i think return 0; is not necessary and will work without it. is it true?