and my output isCode:#include<iostream> using namespace std; bool testsame(int val1, int val2) { if(val1==val2) return true; else false; } int main() { if(testsame(12, 23)) cout<<"Both values are same"<<endl; else cout<<"Values are not same"<<endl; cin.get(); }
but the output is wrong. i know the problem where it is. it in the function testsameCode:Both values are same
when i put return in front of false everything seems tom work fine. i get correct answer. i dont understand why it is?? can any one tell me why this happens if i dont put return keyword keywordCode:return true; else false; }![]()
thank you
s.s.harish



LinkBack URL
About LinkBacks



