Anunay
The function in the above code snippet returns different values for different conditions so that you can take those conditions in consideration in the caller function (eg: main())
Anonymous
Return -1 affect this else if
Anonymous
Can you tell me why is it write -1
Wojak
Can you tell me why is it write -1
Send the complete problem
Danny
Hello new here can I send a problem
Anonymous
Anonymous
Anonymous
su
If any buddy can tell why is it write Return -1;
screw it. ill logic on these code. cause common sense that 'a>b' eq 1, less eq -1, and a==b eq 0
Anonymous
Why we will use -1 in this program
Pavel
Why we will use -1 in this program
Isn't it your code?
Pavel
Return -1 affect this else if
What input do you provide when you get incorrect output (and what incorrect output)
Pavel
the greater check looks legit on the first glance
Anonymous
It is a rock paper scissors game source code
Anonymous
I don't understand that why we use -1 in this programme
Pavel
I don't understand that why we use -1 in this programme
so basically the code works correct, you just want to understand why it's -1? You need 3 values to return, the author have chosen 0, -1, 1
Anonymous
I know -1 is uses to draw the match but I don't understand the logic of this -1 in c programming
Anonymous
Yes code is absolutely right
Pavel
I know -1 is uses to draw the match but I don't understand the logic of this -1 in c programming
-1 is just an integer number, like 1, 2, 10, 150, -90 there's nothing specific about it
Anonymous
But why we write -1 in this place
Pavel
But why we write -1 in this place
because, again, we have three possible results, 0, -1, 1 here we check each
Pavel
they could be 0, 1, 2 if greater returned those
Pavel
or any other numbers
Pavel
also funcelot already mentioned, that it's uncommon to use -1 for draw, better to use 0 for draw and use -1 and 1 for cases when one of the sides win
Anonymous
If I will put 2 on the behalf of -1 then it's run property
Pavel
If I will put 2 on the behalf of -1 then it's run property
yes, you would need to replace both cases where -1 used (return in greater and the if)
Anonymous
Ok it's means it's only a conditions
Anonymous
/get
Anonymous
Guys there r no question papers or any problems tht we can do while praticing.
Anonymous
For Cpp
su
Guys there r no question papers or any problems tht we can do while praticing.
on any of practicing online site avaliable, which supports C++
Anmol
onlinegdb.com
Dima
yeah
Anonymous
yeah
Anmol
Why I am idiot
Mar!o
What happend to the C++ group 😭
Vamsi
/get cbook
Dima
What happend to the C++ group 😭
lets block someone using geoip:>
Mar!o
Dima
keep it on-topic from now
Mar!o
Anyone has used std::pmc? Is it worth it? I've seen a vid...
Mar!o
But has anyone used it in practise and how was the experience?
tibrow
can anyone help me how ans is 16
tibrow
Easy
what are the values go to stack
tibrow
tibrow
2 * 2 * 4
why not 3 comes
Anonymous
2 return 2*fun(3) 3 return 2*fun(4) return 4 Now 2*fun(3) where fun(3) = 2*fun(4) 2*8 16
Anmol
why not 3 comes
Because you're using 2 * fun(n + 1)
Anmol
Not n * fun(n + 1)
tibrow
thanks
zelika
Why is it not reading it as a line even though I do getline ()?
zelika
But it's written on file.
su
But it's written on file.
mostly because getline is user function written without right conventions
Anonymous
Can anyone give me a list of questions of C++ that are normally asked in a C++ developer interview?
Dima
do you even read the rules
su
use gets() just in case
error in file >> text it does not allows spaces in name
Dima
lol fug
Roxifλsz 🇱🇹
lol fug
Gib admin retard
Roxifλsz 🇱🇹
I think I gave you the perms to do that when I left
Pavel
14 11 8 5 3 0 am I correct? 1) postincrement in the function 2) for loop statement has 3 parts - first called only once on init - second called before iteration - third after the iteration
Pavel
Sorry but you wasted your time, I removed that pajeet
🤷‍♂ that was likely wasting of time
Roxifλsz 🇱🇹
Do not "feed" the people who post code photos
Roxifλsz 🇱🇹
They're almost 99% chance absolutely incapable of programming
Dima
Roxifλsz 🇱🇹
Yes, I'm the panda, and the office workers are posting stupid questions
V
Hi guys I need help in a program.
V
Can someone help ?
Roxifλsz 🇱🇹
Can someone help ?
Just ask, someone will eventually help. And no screen photos
Roxifλsz 🇱🇹
Personally I would ban, he had absolutely no other posts besides this OT