Hi just to be curious is this even helpful in programming I haven't seen all the RUclips Tutorials but I just want to know before going further... Isn't this more like helping us with the Mathematics, sorry I'm new to programming and other stuff much help appreciated.
do we always need to initialize the values of the variables in order to carry out an arithmetic operation ? this is kind of absurd , because what happens when we want to carry out sum or any other arithmetic operation later on with variables other than those we initialized for the specified variables ??
Sir, This is harsh and when i was using float variables to obtain the remainder of the value it showed a error : invalid operands of types 'float' and 'float' to binary operator%'
This is used by the following formula. (Quotient*Divisor)+Remainder=Dividend Here we can't divide 10 by 20. So put quotient value 0. Now you multiply this value with divisor value 20. Now you get 0*20=0. Now you subtract this value from Dividend value 10. 10-0=10. So remainder value is 10. Now apply the formula for checking. (0*20)+10=0+10=10
10 /20 = 0 *10+ 10 so modulo = 10 20 /10 = 2*10+0 so modulo = 0 modulo = rest of division 10/20 is 0.5 but int 0.5 = 0 and rest is 10 **sorry for my english ^^*
This is used by the following formula. (Quotient*Divisor)+Remainder=Dividend Here we can't divide 10 by 20. So put quotient value 0. Now you multiply this value with divisor value 20. Now you get 0*20=0. Now you subtract this value from Dividend value 10. 10-0=10. So remainder value is 10. Now apply the formula for checking. (0*20)+10=0+10=10
+Chakri Balaga modulus operation is just for integers.But , if you want to use something similar you need to use fmod(num1,num2) in the program and to put #include at the beginning.Here is a example:#include #include using namespace std;int main(){double num1,num2;cin>>num1>>num2;cout
The Short-Hand operator is too short. I want to know what it actually does, and WHY programmers would use it? If you tell WHY we use certain operators and functions, it makes it better to understand and remember it.
Cindy Yap Writing num1+=num2; is just shorter than writing num1=num1+num2; You don't need to repeatedly write the same thing. I'm fairly certain there's no difference for the machine, though.
bro tell ME how to use MULTI OPERATOR SELECTION IN programe #include using namespace std; int main() { int num1,num2; cout >num1; cout >num2; num1 +=num2; cout
Hi Anil, Thanks for your videos. could you please let me know how to write all the shorthand operators( +=, -=, *=, /=, %=) in a single program. thanks.
Cleared my doubts for modulus operator , thanks
so thankful for you tutorial, finally understand what is modulus
Thanks sir, clear and reachable
My pleasure
4 % 3 = 1
4 % -3 = 1
-4 % 3 = -1
-4 % -3 = -1
cause % calculate remainder and gives sign of numerator
thanks bro u saved my life
tmrw test
my pleasure :)
@@LearningLad u told vdo would be in Hindi where it is?
Sir your teaching style is superb plz sir put some theory and then cover practical thank you
thank you for the suggestion.
i'll try to do it :)
ufff this c++ has so many ways of declaring varaibale and etc
Superb explanation
thank you :)
Hi just to be curious is this even helpful in programming I haven't seen all the RUclips Tutorials but I just want to know before going further...
Isn't this more like helping us with the Mathematics, sorry I'm new to programming and other stuff much help appreciated.
thank you
You're welcome
so complex !! but simple.
thanks you so much
Which compiler r u using
Gnu C++ Compiler
What can i do to keep the work in mind i,m forgetting the done work if going further
sir u should add some more tutorial videos on using graphic function in c++ .
Sure. thank you :)
do we always need to initialize the values of the variables in order to carry out an arithmetic operation ? this is kind of absurd , because what happens when we want to carry out sum or any other arithmetic operation later on with variables other than those we initialized for the specified variables ??
int a=3;
cout
Sir why am I getting output as 2 for program below?
#include
using namespace std;
int main()
{
int a=25;
int b=10;
float c;
c=a/b;
cout
both a and b are of integer type.
so the.5 is ignored.
make them float. it will work :)
thanks sir
hello,
how can we use this short_hand operators for 3variables and more??
Sir...the execution is not happening with "-" and "/".....in my program it gives the value of num1.
Please help me out.
Post your source code
where did you get that 18 from? (2.35). I tried alot but i coudn't find it :/
+Niels Langeweg 3*6=18 , the biggest multiple of 3 smaller than 20
int num1=10,num2=3;
num1+=num2; num1%=num2;
cout
no answer shows 1.
check your program.
Sir, This is harsh and when i was using float variables to obtain the remainder of the value it showed a error : invalid operands of types 'float' and 'float' to binary operator%'
You cannot use the modulus operator on float variables
int a=20, b=3;
cout
if you use cout
Any thing on python in this Chanel?!
at this moment no
= work right to left ( i know some basic) i think in no any previous video we talked about that :/
cout
when i take num 1=10,num 2=20;
then compiler gives answer 10.
y is it so? even i took float but it gave the same answer.
plzz reply..
These is just because modulus will
Give remainder. You give the input
To compiler as 10%20 hence(10/20=10(rem)and 0(q)) thus it will give 10.
This is used by the following formula. (Quotient*Divisor)+Remainder=Dividend
Here we can't divide 10 by 20. So put quotient value 0. Now you multiply this value with divisor value 20. Now you get 0*20=0. Now you subtract this value from Dividend value 10. 10-0=10. So remainder value is 10. Now apply the formula for checking.
(0*20)+10=0+10=10
#include
using namespace std;
int main()
{
int nub1 = 10, nub2 = 20;
cout
10 /20 = 0 *10+ 10 so modulo = 10
20 /10 = 2*10+0 so modulo = 0
modulo = rest of division
10/20 is 0.5 but int 0.5 = 0
and rest is 10
**sorry for my english ^^*
This is used by the following formula. (Quotient*Divisor)+Remainder=Dividend
Here we can't divide 10 by 20. So put quotient value 0. Now you multiply this value with divisor value 20. Now you get 0*20=0. Now you subtract this value from Dividend value 10. 10-0=10. So remainder value is 10. Now apply the formula for checking.
(0*20)+10=0+10=10
why can't i apply modulus operation to float?
+Chakri Balaga modulus operation is just for integers.But , if you want to use something similar you need to use fmod(num1,num2) in the program and to put #include at the beginning.Here is a example:#include #include using namespace std;int main(){double num1,num2;cin>>num1>>num2;cout
The Short-Hand operator is too short. I want to know what it actually does, and WHY programmers would use it? If you tell WHY we use certain operators and functions, it makes it better to understand and remember it.
Cindy Yap Writing num1+=num2; is just shorter than writing num1=num1+num2; You don't need to repeatedly write the same thing. I'm fairly certain there's no difference for the machine, though.
💞💞💞💞💞
Sir can u make C++ tutorials in hindi?
sure. i have plans :)
Learn English, it will help you allt in future.. in india, english i think is becoming first language
bro tell ME how to use MULTI OPERATOR SELECTION IN programe
#include
using namespace std;
int main()
{
int num1,num2;
cout >num1;
cout >num2;
num1 +=num2;
cout
#include
using namespace std;
int main()
{
cout > num1;
cout > num2;
num1 += num2;
cout
Hi Anil, Thanks for your videos.
could you please let me know how to write all the shorthand operators( +=, -=, *=, /=, %=) in a single program.
thanks.
what how?
that depends upon u try that on an example number and then write a program in a generalised form
v
oh i see so the short hand just basically makes it so you dont have to write like so much stuff