Problem related to return true statement

whenever we write a boolean function at last we return either true or false i basically want to understand what does “return true” or '“return false” mean what is the essence of true or false in the last statement, is it necessary to write

Hey @vikash3303 let me explain you the idea of behind function. If i say that in your mobile phone there’s an app name calculator and in it there is a function which gives you arithmetic operation of two number. So this function is returning a value no? That is a(arithmetic operation)b . Similarly in boolean function it performs some operations and return two thing that is either true or false based on the implementation. If you don’t return anything then how will you know that how is your function working. Right? That’s why there’s always a return statement. Later on you will learn more about it :slight_smile:

if a fuction is returing true what does this mean because here we are not returing any value

Okay now suppose if i give you a number and ask you to tell me if it’s a prime or not. You find it’s divisor and if you find any of his divisor you say false it’s a prime number. But if you don’t find any of it’s divisor you say true it’s a prime number. Now in place of you I have planted this function. And now that function is telling me whether that has to return true or false. That’s how return statement works.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

if i want to iterate from i=2 to root n then sir is writing for (int i=2 ;i*i<n;i++) how

i<root(n) is same as i^2<n, so we write for (int i=2 ;i*i<n;i++)

what does “LL” mean as in code for(LL j=3

hello @vikash3303

u have reopend the doubt, if u still have any doubt then pls ask it here

bhaiya might have have defined macro for long long.
ie
#define ll long long
ll is now an alias for long long ( ie ll is now another name of long long)