+ 9
What's the problem with it ? Kindly fix it and explain it to me ??
void showOnScreen() { cout<<"Programming makes life interesting"; } #include<iostream> using namespace std; int main() { char showOnScreen; cout<<showOnScreen; return 0; }
12 Respostas
+ 9
Nikhil Dhama
thanks đđ
+ 9
SUNIL BHAGAT
thanks đ
+ 9
Learner
thanks đ
+ 8
Learner
?
+ 8
BrainsđłđŹ
thank you đ
+ 7
+ 7
+ 7
first of all always try to include headers before writing any other definitions.
(it doesn't mean you cann't define earlier, yes you can, but it's better to define later and you will get to know this after taking a dive into programing)
first you are defining fns and then later telling compiler that you are using namespace std,
so in your fns defintion write cout as std:: cout,
or include namespace earlier.
second your calling of fn is incorrect. or in place you defined a char type variable with the same name as your fn's name.
function calling should be like
showonscreen(); //that's it
+ 6
Here showOnscreen is a function so you should make a function call for a proper execution <!--I think-->
+ 5
there are few errors in your code.
+ 3
You declared your namespace in the wrong place.
namespaces and headers should be declared at the top..before any function declaration...
thats why you have a "cout was not declared" error.
and the function call is wrong..
+ 2
you don't need char line.
only
court<<showOnScreen();