C++ Multiple Return Statements in Functions | CPP Programming Video Tutorial

preview_player
Показать описание
In this c++ / cpp programming video tutorials / lecture for beginners video series, you will learn how to use multiple return statements in functions.

You will learn what is the use of return statement and also how to use return statement in functions.

Learn Programming in HINDI at our youtube channel

Catch us on SocialMedia
Рекомендации по теме
Комментарии
Автор

Your Videos are so good!Thanx a lot Anil !

jojo-fpzv
Автор

Thank you brother, your videos help me a lot learning c++...

inocenciopatronjr
Автор

I can't thank enough bcz these videos helped me a lot to do program fast...

scemsoldiersofchrist
Автор

sir what return TRUE & FALSE affect to program ???

visheshraval
Автор

Sir what is the use of this return statements now however we executed the program without having them I mean to say that checking will be done in calling and output is displayed. What's the use of this return statements??? Plz tell me sir.

SAISRIVIDYA
Автор

i made the code better to look

#include <iostream>

using namespace std;

bool check(int);


int main()
{
int x;
cout<<"enter your age ";
cin>>x;
if(check(x))

cout<<"you are kid";
else
cout<<"you are adult";
return 0;

}
bool check(int age){

if(age<18)
return true;
else
return false;

}

HallOfMemeYT
Автор

Sir,
How can a keyword be a function name, function with return value or non return value at the end will be treated as a variable ?

TheShubham
Автор

we can also multiple return statement for Switch statement.

sing
Автор

why u returned true or false by returning age also we can get the same output.then what is the purpose of returning true or false.there is no difference please explain

aakashkonduru
Автор

what is effect of return true or false...?
and this program gives error in main function return 0.
sir plz reply

akashbhavsar
Автор

#include <iostream>
using namespace std;
int a;
bool check(int);
int main() {
cout << "Care este varsta ta ?";
cin >> a;
if (check(a)) {
cout << "Esti adult " << endl;

}
else
cout << "Esti un copil " << endl;

system("pause");
}
bool check(int a) {
if (a >= 18)
return true;
else
return false;
}

unuzer
Автор

i didn't understand this vedio .i have a doubt how to consult you.

aakashkonduru
Автор

i made code better
#include <iostream>

using namespace std;

bool check(int);


int main()
{
int x;
cout<<"enter your age ";
cin>>x;
if(check(x))

cout<<"you are kid";
else
cout<<"you are adult";
return 0;

}
bool check(int age){

if(age<18)
return true;
else
return false;

}

HallOfMemeYT
join shbcf.ru