9 Topics

Member Avatar for
Member Avatar for saurabh.mehta.33234

#include<stdio.h> void main() { int n=5; if(n==5?printf("Hallo"):printf("Hai"),printf("Bye")); } The output of the above code is HalloBye..But I am not able to debug it..I know that ternary has precedence over comma operator but i am stuck at which operand will go with which operator..Can someone please help

Member Avatar for Moschops
-1
235
Member Avatar for nitin1

int m= i++ || ++j && k--; where i=2, j=3, amd k=5; acooridng to me, it will be executed left to right and then values of m=1, i=3, j=3 and k=5. but i have seen that precednace of && is more than || , than so how this expression is …

Member Avatar for Banfa
0
283
Member Avatar for aravind326

Hi, I am just trying to do some program on arithmetic expression parsing. So i want to store my operator precedence table in the program somehow. I could use a multidimensional array, but that would be inefficient i guess. Another idea i have is to use a HashTable, where the …

Member Avatar for aravind326
0
448
Member Avatar for starkk

main() { int x=20,y=35; x=y++ + x++; y= ++y + ++x; printf(“%d%dn”,x,y); } what would be the output? can some one explain it with associativity and operator precendence

Member Avatar for WaltP
0
85
Member Avatar for wildplace

let say i have an expression like the one below, I guess it goes from left to right? if(exp1 && (exp2 && exp3 || exp4) || exp5)

Member Avatar for wildplace
0
111
Member Avatar for ronnieaka

here's the infix expression: [B]EXAMPLE 1[/B] a/(b+c)*d according to me, if [B]*[/B] is given higher precedence then [B]/[/B] , then this should be the postfix expression: [B]1) abc+d*/ [/B] if / has higher priority then * , then: [B]2) abc+/d*[/B] [B]question 1: [/B]which is correct?? 1 or 2 ? according …

Member Avatar for TrustyTony
0
236
Member Avatar for daudiam

b=c/d++; In this, first d is incremented (because ++ has a higher priority than / or =), but c is divided by the unincremented value of d. Thus, the order of evaluation in this case is well-defined. But if we had written the above as: b=(c)/(d++) then which operand ( …

Member Avatar for daudiam
0
238
Member Avatar for hschroeter

hello, there is a main xslt-script with a "do_this_and_that"-template. in an from the main included script ther is such "do_this_and_that"-template too. is it possible to call the "do_this_and_that"-template from the main by this included "do_this_and_that"-template? many thanks for your answer(s)

Member Avatar for fpmurphy
-1
112
Member Avatar for Salem

This is a catalogue of some experiments on just two aspects of undefined behaviour. This was inspired by yet another long bout of explanation in a recent thread, so I thought it was time to dust off a bunch of compilers, and compare. This is the test code. [code] #include …

Member Avatar for frk
4
577

The End.