Conditional Operator in C

  Рет қаралды 272,972

Neso Academy

Neso Academy

Күн бұрын

Пікірлер
@ProgrammingwithArijit
@ProgrammingwithArijit 4 жыл бұрын
Ans will be 65. Explanation: lets break the problem into part (1) At first the condition is sizeof(var) if this condition is evaluated to be true then (var2>23 ? ((var==75) ? 'A' : 0) : 0) will be returned if false then 0 will be returned As we know sizeof() is an unary operator which returns how many byte a datatype can hold as var is an variable of integer data type , sizeof(var) will either return 2 or 4 as machine to machine int vary . We know every number except 0 is evaluated to be true. So (var2>23 ? ((var==75) ? 'A' : 0) : 0) it will returned (2)next the condition is (var2>23) if this condition is evaluated to be true then ((var==75) ? 'A' : 0) will be returned if false then 0 will be returned as we know 56>23 is true then ((var==75) ? 'A' : 0) will be returned. (3)the condition is (var==75) if this condition is evaluated to be true then 'A' will be returned if false then 0 will be returned As 75==75 then 'A' will be returned and stored into num variable As c support auto type casting so int can store char. In the final printf function we use the placeholder %d and it print integer value . According to Ascii integer value of 'A' is 65 So the output will be 65.
@daytrade1013
@daytrade1013 4 жыл бұрын
Thank you
@harshmk1052
@harshmk1052 4 жыл бұрын
Thanks a lot :)
@mehadihasansanto538
@mehadihasansanto538 4 жыл бұрын
Why don't you think that ((var==75)? 'A' : 0) will be evaluated first? [As we know that bracket has the highest precedence than any other operator in C.]
@ayushvats1808
@ayushvats1808 4 жыл бұрын
@@mehadihasansanto538 xactly this is my doubt and i think bracket will only be evaluated first
@mehadihasansanto538
@mehadihasansanto538 4 жыл бұрын
@@ayushvats1808 Yeah, Brother. I also think so. Moreover, the associativity of conditional operator(? :) works from right to left. That's why I think ((var == 75)? 'A' : 0) will be evaluated first.
@102ayushkumar3
@102ayushkumar3 4 жыл бұрын
Answer -> 65 Solution -> num = sizeof(var) ? (var2 > 23 ? ((var == 75) ? 'A' : 0) : 0) : 0; as we know, var==75 is True, therefore, (var == 75) ? 'A' : 0 will be equal to 'A'. Then we will replace the equation with 'A' in the main equation. num = sizeof(var) ? (var2 > 23 ? 'A' : 0) : 0; as we know, var2 == 56, hence greater than 23, therefore, var2 > 23 ? 'A' : 0 will be equal to 'A'. Then we will replace the equation with 'A' in the main equation. num = sizeof(var) ? 'A' : 0; as we know, as condition is True if the result of expression is any number except 0, sizeof(var) == 4, as its an integer data type. sizeof(var) is a True statement, therefore, sizeof(var) ? 'A' : 0 will be equal to 'A'. This implies num = 'A'; In the printf statement, the format specifier of num is %d, so the ASCII value of the character will be printed. ASCII value of 'A' = 65.
@acoinhastwosides5239
@acoinhastwosides5239 Жыл бұрын
You make it understandable. You remove my confusion to explain it line by line. Thax
@pranaylambat9743
@pranaylambat9743 5 жыл бұрын
O/p is 65 ... because all three condition are true...sizeof(var) Shows the size of int (which is other than 0 ....and then after all condition are executed it will return A and the decimal of A is 65 .. according to ASCII TABLE
@Gautamsingh-dy4cp
@Gautamsingh-dy4cp 5 жыл бұрын
But here parenthesis is given first evaluate parenthesis then applied conditional ..
@saiyadav5014
@saiyadav5014 5 жыл бұрын
By evaluating with the parentheses the answer will be A. But in what manner computer will execute.?
@kajolnimesh483
@kajolnimesh483 5 жыл бұрын
@@saiyadav5014 Answer should A for sure as all the conditions are true, but compiler should execute A as a integer value as it is assigned to num variable that is integer variable.
@sairakeshdurga600
@sairakeshdurga600 4 жыл бұрын
tq bro
@udaykumar-es2el
@udaykumar-es2el 3 жыл бұрын
@@Gautamsingh-dy4cp but as for associvity rule it caan be done from left to right
@randomthief7838
@randomthief7838 5 жыл бұрын
Interesting lectures and also they are making to think for every homework questions.
@millenmarbun24
@millenmarbun24 6 жыл бұрын
it will be wayyy better if you can explain the homework problems @nesoacademy sometimes I can't fully comprehend the answers
@creative_editzs1862
@creative_editzs1862 5 жыл бұрын
yes
@sarthak_jain_51515
@sarthak_jain_51515 4 жыл бұрын
Yes
@brocklesnarufcchamp1
@brocklesnarufcchamp1 4 жыл бұрын
Yeah, that would be really nice :(
@AK--vc9wd
@AK--vc9wd 3 жыл бұрын
65
@kanthurijaswanthroyal5685
@kanthurijaswanthroyal5685 2 жыл бұрын
@@AK--vc9wd I to get the same answer
@wajahatriazmirza
@wajahatriazmirza 4 жыл бұрын
The answer is 65 First we will solve the inner brackets. According to that our condition is true so it will store the corresponding value of A according to ASCII i.e. 65 (because we are dealing with integer datatype). Then we will work our way out solving the outer brackets one by one. Hence the final answer is 65.
@ahmedsedeek2814
@ahmedsedeek2814 5 жыл бұрын
okay guys , here is the point .. if we considered it as an if statement , it'll be as following ; ) int var = 75 , var2 = 65; int num ; if(sizeof(var)) { if(var2 > 23) { if(var == 75) { num = 'A'; } } printf("%d" , num); } else return 0; the output is gonna be 65 , and this is according to ASCII table , as 'A' is = 65 ..
@khalilrin-ju3nm
@khalilrin-ju3nm 5 жыл бұрын
thank you very much for explanation Mr Sedeek. If you do not mind i will ask you questions in future too
@nbk330
@nbk330 4 жыл бұрын
by looking at this equation now i understood the last stage of the problem clearly
@ekanshkhanulia4078
@ekanshkhanulia4078 4 жыл бұрын
Please make your own videos,no gyan choding here
@Gaurav-zh4pm
@Gaurav-zh4pm 3 жыл бұрын
else statements biro ?
@pavanroyal8183
@pavanroyal8183 3 жыл бұрын
Var 2 is 56 .how u right 65?
@justindenison7029
@justindenison7029 4 жыл бұрын
Output will be the ASCI code of 'A' =65; Thank you for your efforts, I like your explanation so much ❤
@sowmithb4673
@sowmithb4673 2 жыл бұрын
thanks bro
@soumi6720
@soumi6720 2 жыл бұрын
hands down this is the best channel . pls continue blessing us with valuable information.
@satishsgm0157
@satishsgm0157 3 жыл бұрын
First rule to be followed while solving these type of conditions is: First of all we need to divide given expression into three parts i.e L|M|R And then start evaluate each and expression. Al last num variable initialised by A which is equivalent of 65.
@rsingh6216
@rsingh6216 4 жыл бұрын
This question is like 10 questions in one question. Neso team is great.
@gautam1801
@gautam1801 3 жыл бұрын
Thanks for teaching me something in 5 minutes that my teacher took two 50 minutes classes for! 😃😃
@kunalkhallar9699
@kunalkhallar9699 Жыл бұрын
I think that's the main reason, why does our education system lag behind.
@sumit4789
@sumit4789 Жыл бұрын
true uncle@@kunalkhallar9699
@bengalisareeshubstore3633
@bengalisareeshubstore3633 3 жыл бұрын
Result is 65, start to solve from the inner bracket to the outer bracket, fixed inputs and take care of format specifier used during output, it will convert the result A into ASCII decimal 65 (%d is used for output)
@98_shubhamr.sharma78
@98_shubhamr.sharma78 3 жыл бұрын
Sir please solve homework problems also so that we can give it a try and if we are not able to solve it then we can refer to your explanation that would really really be helpful for beginners like me and all would really appreciate that effort of yours!!!! 🙏🙏🙏🙏
@jayap8355
@jayap8355 4 жыл бұрын
O/p - ASCII Value of A= 65 Explained it perfectly man!!!!
@shashankpandey6428
@shashankpandey6428 4 жыл бұрын
Thanks a lot for videos sir ❣️. It's really helpful.
@APstudent-y6s
@APstudent-y6s 11 ай бұрын
5:22 o/p is 65 thanks a bunch to the tutor n nesoAcademy ❤🙏
@AYUSHSINGH-pv3pl
@AYUSHSINGH-pv3pl 3 жыл бұрын
#solution #include int main() { int var=75,var2=56,num; num=sizeof(var)?(var>23? ((var==75)?'A':0):0):0; printf(" the num is :%d",num); return 0; } output=65
@helloHima790
@helloHima790 4 жыл бұрын
65 since sizeof var is 4or 8 according to processor which is True in boolean form and ascii value of A is 65 as we need to print in integer the value.
@aniketnandi7478
@aniketnandi7478 6 жыл бұрын
*/Output will be*/ 65 as per the expression, the result will be 'A' and it will be stored in num. But, num is int type data So, 'A' will be converted to its corresponding ASCII value which is 65.
@Tejaswini01212
@Tejaswini01212 Жыл бұрын
Ans of H.W:It will print 65 that means the o/p of code is 'A' 65 is a ASCII value of capital 'A'.
@sumanroy4615
@sumanroy4615 4 жыл бұрын
Ans will be 65 because the return value of 'num' is equal to 'A' according to ASCII table the value of A is 65.
@otetumooluwaseun3948
@otetumooluwaseun3948 Жыл бұрын
All other inner conditional expressions will be treated first. They return true. Then, the main operand, sizeof, returns true which implies 'A' will be returned. Since %d specifier was used, the printf will print the decimal value of character A, which is 65.
@pramodinireddy1553
@pramodinireddy1553 3 жыл бұрын
Your classes are amazing sir , the way you explain with examples makes us more easier to understand the topics .
@davidebenedettivalentini1812
@davidebenedettivalentini1812 11 ай бұрын
Easy explanation of last exercise: Remember that Expression1 ? Expression 2 : Expression 3 means: if Expression1 is True return Expression 2, else return Expression 3 so rephrasing the exercise we get: if (sizeof(var) is True return (if (var2 > 23) is True return ( if var == 75 return 'A' else return 0) else return 0) else return 0. Now just remember var is int and sizeof(int) returns 4 (which C reads as True) and ascii code of 'A' is 65 (i read it from other answers)
@harshantbaraiya4712
@harshantbaraiya4712 Жыл бұрын
int var = 75; declares and initializes an integer variable var with the value 75. int var2 = 56; declares and initializes another integer variable var2 with the value 56. int num; declares an integer variable num without initializing it. Now, let's analyze the following line: num = sizeof(var) ? (var2 > 23 ? ((var == 75) ? 'A' : 0) : 0) : 0; This line uses nested conditional operators to assign a value to num based on several conditions: sizeof(var) calculates the size of the var variable, which is 4 bytes (assuming a typical 32-bit system). var2 > 23 checks if var2 is greater than 23, which is true because var2 is 56. (var == 75) ? 'A' : 0 checks if var is equal to 75. If it is, it assigns the character 'A' to num; otherwise, it assigns 0. So, the value of num will be 'A' because both sizeof(var) and var2 > 23 are true, and var is indeed equal to 75. Finally, the code prints the value of num using printf, which will output 'A' as a character (ASCII value of 'A' is 65). Therefore, the output of this code will be: A
@tufanchakraborty5925
@tufanchakraborty5925 4 жыл бұрын
65 Tip: use different bracket such as {}()
@cirobermudez
@cirobermudez 6 жыл бұрын
The output of the programa is A, because as sizeof(var) is diferent to 0 it enters to the first true statement, then it checks if var2 > 23, that is true, so finally checks it var == 75, again this is true so num equal to A
@cirobermudez
@cirobermudez 6 жыл бұрын
Lakshman Patel, thanks
@ankurdutta5641
@ankurdutta5641 5 жыл бұрын
@@lakshmanpatelofficial but why is 65 ?
@SerajAlhorany
@SerajAlhorany 4 ай бұрын
@@ankurdutta5641 A = 65 according to ASCll
@HDP76
@HDP76 4 жыл бұрын
Out put will be 65 Since program execution begins from main function Declared variable var and assigned 75 to it Declared another variable var2 and assigned 56 to it Declared num integer type And given condition sizeof is unary operator since given sizeof(int) it returns 2 or 4 bytes depends on the compiler machine.How many bytes int will occupy it returns We know that if the condition is false it returns 0 and other than 0 returns 1 so now our condition is true it checks other condition of that true it checks other condition finally it returns A and num is assigned with A and it will be printed since the value of A according to ASCII in c is 65
@ashishtayade047
@ashishtayade047 Жыл бұрын
Thank you sir very nice gide & very nice best information conditional operator teaching video.👍
@abhijit2231
@abhijit2231 4 жыл бұрын
Output will be ASCII value of 'A' ie. 65
@reginahshikanda6478
@reginahshikanda6478 Жыл бұрын
Answer is 65 , thank you so much for this lectures
@mislead1070
@mislead1070 3 жыл бұрын
The ans is 65 i.e. Numerical equivalent of the letter A. Explaination: The first condition/expression will return the size of var which is ofcourse more than 0, and as we all know, any value other than 0 is said to be true, so hence, the next expression will get terminated, which is again true... Bec var2 i.e. 56 > 23, thus the next expression will get terminated which i again true as we can see the value of var is 75, So thus, being true it will again terminate the true statement, But this time, there is no condition and its just a letter 'A', So as it being the last one of the conditions, the 'A' will get stored in num And as we know, ("%d") prints numerical values, so even if we store alphabetical values, it will convert the alphabetical value to its Numerical equivalent according to the ASCII Table and thus we will be getting the output as 'A' i.e. 65.
@fahimarian2264
@fahimarian2264 6 жыл бұрын
Output will be : 65
@aldaiansaklain
@aldaiansaklain 6 ай бұрын
Really awesome classes.
@sachinkumbar3789
@sachinkumbar3789 4 жыл бұрын
It will print output as a 65 which is ASCII equivalent of 'A'
@deepeshsunuwar1086
@deepeshsunuwar1086 4 жыл бұрын
all the three boolean returns true value so the value of num is "A" then the ASCII value of A is printed. so the final answer will be 65...........
@sdk28
@sdk28 3 жыл бұрын
Steps occured: 1. num = sizeof(var) ? (var > 23 ? ((var == 75) ? 'A' : 0) : 0) : 0; 2. num = sizeof(var) ? (var > 23 ? ('A') : 0) : 0; 3. num = sizeof(var) ? (('A')) : 0; 4. num = (('A')); Thus, num = 65 (when expressed in integer format)
@ssenapati3328
@ssenapati3328 5 жыл бұрын
Pls tell the ans with ur explain @neso academy.. All doute are clear
@adityajayswal1303
@adityajayswal1303 3 жыл бұрын
65 or wot blissed lectures.....
@Kim_jong_un69
@Kim_jong_un69 2 жыл бұрын
Will print 65 because 65 is the ASCII value of A if you use print("%c", num); instead of %d you will get A.
@AsteriskYoutube
@AsteriskYoutube 4 жыл бұрын
Sir I’m studying only 10th standard but learning c from u thanks a lot sir and I got the answer for ur homework problem as 0 if wrong plz explain by replying to me
@ravindra_sings_
@ravindra_sings_ 3 жыл бұрын
ans is 65
@ravindra_sings_
@ravindra_sings_ 3 жыл бұрын
Ans will be 65. Explanation: lets break the problem into part (1) At first the condition is sizeof(var) if this condition is evaluated to be true then (var2>23 ? ((var==75) ? 'A' : 0) : 0) will be returned if false then 0 will be returned As we know sizeof() is an unary operator which returns how many byte a datatype can hold as var is an variable of integer data type , sizeof(var) will either return 2 or 4 as machine to machine int vary . We know every number except 0 is evaluated to be true. So (var2>23 ? ((var==75) ? 'A' : 0) : 0) it will returned (2)next the condition is (var2>23) if this condition is evaluated to be true then ((var==75) ? 'A' : 0) will be returned if false then 0 will be returned as we know 56>23 is true then ((var==75) ? 'A' : 0) will be returned. (3)the condition is (var==75) if this condition is evaluated to be true then 'A' will be returned if false then 0 will be returned As 75==75 then 'A' will be returned and stored into num variable As c support auto type casting so int can store char. In the final printf function we use the placeholder %d and it print integer value . According to Ascii integer value of 'A' is 65 So the output will be 65.Ans will be 65.
@Xero75
@Xero75 2 жыл бұрын
Great job kn explaining this! Thank you 😊 soo much
@vittorio9763
@vittorio9763 2 жыл бұрын
Output is 65, the decimal value of A
@NMAJJINEERAJA
@NMAJJINEERAJA 4 жыл бұрын
ASCII code of 'A' will be the answer and that is 65
@AbhinavKumar-qv7to
@AbhinavKumar-qv7to 2 жыл бұрын
65 ans because 'A' will be stored in num and due to %d it will be printed in ascii encoding equivalent 65.
@akritibhan5858
@akritibhan5858 3 жыл бұрын
questions are just amazing..
@brotherinterest6912
@brotherinterest6912 2 жыл бұрын
so as i think that we have break it inside the bracket (var==75)?'A':0 then the answer is A because 75 is equal to 75. then, (var2>23?'A':0) then the answer will be A because 56 is greater than 23. then, we have sizeof(var)?'A':0; then the ascii A will be implemented that is 65
@Sekhar_Home
@Sekhar_Home 4 жыл бұрын
Thnx . U have given me a best lecture
@mechguy0404
@mechguy0404 3 жыл бұрын
the answer will be 65, the ASCII value of 'A'. As each of the three statements is true so expression 2 of each statement will be the outcome.
@andistheinforitbutso7513
@andistheinforitbutso7513 3 жыл бұрын
Good morning 🙏 🌄
@venkatesh3439
@venkatesh3439 5 жыл бұрын
Var==75 true A Var2>23 true A Sizeof(var) 4 non zero true A A is character we are using %d A ASCII value 65
@manalkhazraj
@manalkhazraj 5 жыл бұрын
But how could the size of var be A?
@balaagisp8490
@balaagisp8490 4 жыл бұрын
Ans is A because all 3 statement is true and if true the ans is A. But in printf it's %d which is integer and value of A is 65 in decimal so Final ans = 65
@raiderpsk9690
@raiderpsk9690 8 ай бұрын
'A' is implicitly convert to int to become 65
@ahmedmomtaz8696
@ahmedmomtaz8696 3 жыл бұрын
The answer 65 From inside out ((Var==75)?’A’:0 True. ‘A’. Then Var2>23?’A’:0. True. ‘A’ then Sizeof(var) ?’A’:0. True. ‘A’ Nume=‘A’ Nume=65
@Dwarika_Sahu
@Dwarika_Sahu 5 жыл бұрын
Thank you so much for this information
@Rest_leave
@Rest_leave 4 жыл бұрын
Whole expression is true that's by it has to return 65(at the place of A because c supports auto casting).
@unaib7676
@unaib7676 5 жыл бұрын
65 because all conditions are true hence variable contain A and in decimal it will be 65
@md.hasanmahmud416
@md.hasanmahmud416 2 жыл бұрын
//We can think just like that if (sizeof(var)) { // 4 = true so go inside if(var2>23) { // 56>23=true so go inside if (var==75) { //var=var= true so go inside num='A'; // Final 'A' will assign in num else num=0; } else num=0; } else num=0; }
@VijayKumar-tp9ux
@VijayKumar-tp9ux Жыл бұрын
Nice steps bro👏
@waterford7736
@waterford7736 2 жыл бұрын
Excellent👍
@nexrainlyrical7876
@nexrainlyrical7876 3 жыл бұрын
answer --> 51 explanation a=7; a^=5--> a=a^5--> a=2 printf("%d",a+=3)--> a+=3-->a=a+3--->a=5; printf("%d",printf(printf("%d",a+=3));------->51 ans only one character is there so 1 will be printed after 5..
@balaagisp8490
@balaagisp8490 4 жыл бұрын
Ans A ASCII value of A is 65
@duconsao3768
@duconsao3768 3 жыл бұрын
what is the definition of tenary operator 3:28
@sajooj7948
@sajooj7948 3 жыл бұрын
can you determine the size of on your own without using the sizeof() operator? is it like a rule where int is always 4? And do we start solving the expression from the parenthese on the inside or outside first?
@randomthief7838
@randomthief7838 5 жыл бұрын
65 stand for character A All the conditions are true.
@goutamvohra3442
@goutamvohra3442 4 жыл бұрын
Ans is A but the return value is in the form of int datatype then it will transform into ASCII format return the value of A is 65 So the output is 65
@sanyagandhi6576
@sanyagandhi6576 4 жыл бұрын
size of var is something other than 0 therefore, the condition is going to be true and A will be printed.
@gauravvaidya1868
@gauravvaidya1868 4 жыл бұрын
There is %d which is decimal placeholder therefore it's ASCII value will be printed which is 65
@nagasubramanian875
@nagasubramanian875 3 жыл бұрын
Let me make it easier Expression is: Sizeof(var)?(var2>23?((var==75)'A':0):0):0 Now let's separate into 3 segments 1st (var==75)?'A':0 2nd (var2>23)?'A':0 3rd sizeof(var)?'A':0 Ans for 1: 75==75 so A is returned Ans for 2:. 2>23 so A is returned Ans for 3: A A is output and the ASCII value of A is 65
@happy_girls
@happy_girls 2 жыл бұрын
👍👍👍🥰
@rsingh6216
@rsingh6216 4 жыл бұрын
I solved in first attempt , before this playlist ,i used to write stdio.h to studio.h
@agamgill9563
@agamgill9563 6 жыл бұрын
Numeric value of a return 65
@sirnoxy2534
@sirnoxy2534 2 жыл бұрын
Hurray!! Got the answer in just one go! BTW ans is 65.
@AbbaJi-gm4vc
@AbbaJi-gm4vc 5 жыл бұрын
Sir please give the solution video also so that we can compare our result
@gauravjoshi4865
@gauravjoshi4865 4 жыл бұрын
65 ASCII code of "A"
@ritiksaxenaofficial
@ritiksaxenaofficial 5 жыл бұрын
Output is 65...ascii of A
@anandkumar-bd2ru
@anandkumar-bd2ru 2 жыл бұрын
65. // Ascii value of 'A'
@porankirajkumar4709
@porankirajkumar4709 2 жыл бұрын
As the variable num is of data type integer how can it take of char 'A' as its value and print 65 in integer
@anjani_tiwari
@anjani_tiwari Жыл бұрын
int var = 75; int var2 = 56; int num; num = sizeof(var) ? (var2 > 23 ? ((var == 75) ? 'A' : 0) : 0) : 0; num = sizeof(var) ? 'A' : 0; num = sizeof(var) ? 'A' : 0; num = 65
@JackVaileon
@JackVaileon 11 ай бұрын
I wonder if we can solve not from inner bracket but from the outer bracket, in this HW, both conditions are the same.
@chinua2518
@chinua2518 3 жыл бұрын
answer is A, since all conditions happen to be true in all tested case.
@xiaoshan9722
@xiaoshan9722 3 жыл бұрын
the num = A ,but the output should be decimal number, then it convert to its binary representation 65
@Gautamsingh-dy4cp
@Gautamsingh-dy4cp 5 жыл бұрын
Sir firstly applied parenthesis operation after that apply ternary operator..first offl all remove parenthesis then evaluate ..it true or not
@hikmathasanov
@hikmathasanov 3 жыл бұрын
65 will be printed, since it is the decimal value of character A.
@saeedakther7023
@saeedakther7023 2 жыл бұрын
Please explain again condition operation
@the_mitwa
@the_mitwa Жыл бұрын
Which ternary operator gets evaluated first?
@vishalyadav067
@vishalyadav067 3 жыл бұрын
Output is 'A', how A become 65 ,pls anyone explain me.....???ohhh i gotted because be are storing value of char data type in int data type as a answer.....if we are using char num .....than answer is A .....👍👍🙏 Char Value of A to Z in int value A=65 B=66 C=67 D=68 So on...
@AbdElrahmanAmirMohamed
@AbdElrahmanAmirMohamed 4 жыл бұрын
answer = 65 .... this is the decimal number parallel to "A" in ascii table.
@venkat230
@venkat230 4 жыл бұрын
Single quotations are responsible for printing ASCII value of A
@mobeenshaik4219
@mobeenshaik4219 4 жыл бұрын
O/p will be 2 bcz sizeof doesn't evaluate expression
@karanneelkanth8318
@karanneelkanth8318 3 жыл бұрын
Output will be ASCII VALUE OF A
@heyrishabh13
@heyrishabh13 5 жыл бұрын
ASCII value of 'A' may be the answer.
@Rahulsingh-mq2ny
@Rahulsingh-mq2ny 5 жыл бұрын
65
@rajdeepray4009
@rajdeepray4009 4 жыл бұрын
1st: sizeof (var)? (var2>23 ? ((var==75)? 'A' : 0) : 0) : 0 ; is evaluated and here sizeof(var) is either 2 or 4 (depends on machine to machine), not zero. and go for next expression: (var2>23 ? ((var==75)? 'A' : 0) : 0) 2nd: (var2>23 ? ((var==75)? 'A' : 0) : 0) is evaluated and here var2>23 this also true and to for next expression: (var==75)? 'A' : 0) 3rd: (var==75) ? 'A' : 0 is evaluated and here var==75 is true, so 'A' go forward.Then 'A' is assigned with num and then print 'A' in integer form: 65 (ASCII)
@neelabauri9503
@neelabauri9503 2 жыл бұрын
do we have to memorise the ascii table values?
@selvalakshmis.v4232
@selvalakshmis.v4232 3 жыл бұрын
65. Thank you, Sir
@DarkyS73
@DarkyS73 4 жыл бұрын
thank you so much sir
@jagath123-m2r
@jagath123-m2r 5 жыл бұрын
Both conditions are satisfied and print A value or A
@recursiveminds
@recursiveminds 5 жыл бұрын
output is 65 because 65 is acii value of A
@vinaykumarreddy9956
@vinaykumarreddy9956 3 жыл бұрын
using return in ternary operator is allowed?
@deekshdeekshitha6744
@deekshdeekshitha6744 4 жыл бұрын
Output of assignment is 65
@manuvenu28
@manuvenu28 3 жыл бұрын
It's the ascii value of A
@ritikshrivastava9442
@ritikshrivastava9442 4 жыл бұрын
Sir, I am unable to understand that last problem but I know how to use if else or nested as well so I break down that problem into if else #include int main() { int a=75; int b=56; int num; if(sizeof(a)) { if(b>23) { if(a ==75) { num = 'A'; } } printf("%d",num); } return 0; } And I have questions as we need to learn the ASCI table ? For i.e if we go for an interview the question arrive in which ASCI table is used in output so in that situation what we do? So pls tell should we learn that or these type of questions is not being asked in interview
@rishisingh7237
@rishisingh7237 4 жыл бұрын
I also have same doubt
Comma Operator in C
8:30
Neso Academy
Рет қаралды 188 М.
Recursion in C
11:12
Neso Academy
Рет қаралды 975 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
C++ Ternary Operator (Conditional Operator) | CPP Video Tutorial
4:44
Zelensky Announces Talks with Russia / End of Martial Law?
13:55
NEXTA Live
Рет қаралды 1,1 МЛН
Bitwise Operators in C (Part 1)
7:52
Neso Academy
Рет қаралды 836 М.
But what is a neural network? | Deep learning chapter 1
18:40
3Blue1Brown
Рет қаралды 18 МЛН
Precedence and Associativity of Operators
16:27
Neso Academy
Рет қаралды 362 М.
#10: Ternary Operator in C | C Programming for Beginners
6:38
Programiz
Рет қаралды 114 М.
WHY IS THE HEAP SO SLOW?
17:53
Core Dumped
Рет қаралды 292 М.
Bitwise Operators and WHY we use them
8:41
Alex Hyett
Рет қаралды 97 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН