I don't think the compiler would compile this without errors. What is f and what value would m take? that is just random.
And n==m++ is not assignment too. Its just logical comparison.
Please correct me if i am wrong.
Thanks
gourav
Dec 24th, 2005
hi,
n==m++ is not an assingment,but it is a logical comparision.
int n=f,m;
int n==m++; // in this statement m is incremented to m+1//
int m==++n; // in this statement n is incremented to f+1//
print(n,m);
ans: (f+1,m+1)
sachin
Dec 26th, 2005
Hi,
Here f should ' f ' o/w compiler will give error as it will be considered as a variable........ it will assign the ASCII value of 'f ' to n i.e. 102 ......... then the values of m and n will be incremented by 1 so the output should be ................ 103 1
ANISH
Feb 14th, 2006
n=m++.......so the ascii value of m will increment and it will become n so now n=nnext step is m=++n. similarly here ascii value of n will increment .soans is m=om=o n=n
teju
Mar 7th, 2006
i guess there are many problems in the question above first that f is not declared b4 and is directly assigned to n
and nxt the printf statement is given as print so we may come acrooss these two prob and hence this may not work
Shyamsundar
Jun 7th, 2006
the progrm will not run bcoz compilation error occurs @ undefined symbl 'f'.
purani
Jun 18th, 2006
first of all we cannot assign two value to the same variable as given n=f,m
the error occurs there itself so it results in compilation error
urmila
Jun 24th, 2006
as both n,m are not assigned,i think n would be assigned to the ascii value of f and m to be zero.am i right??
ravi kiran
Jun 27th, 2006
Hi friends i think it rises an error because it does not know the values f, m. so we get error undefined symbols f, m;
Ravi kiran
gopi
Jul 20th, 2006
no o/p, only errors and warnings..
f needs to be declared in order to assign it and parameters do not match with the prototype of printf.. bla bla
rajesh
Aug 21st, 2006
the above question shows an error here f is not declared.(==)code has noeffect to execute.the printfstatement is not displayed.it has no prototype.
Benazir
Sep 26th, 2006
Hello..I feel the answer is that this will not work. f is undefined. printf statement should be rectified. c ya.
ASCII value of f is 102 its assign to n,
n==m++ takes m default value/or random value depend on type of m ether its global or local. this instruction only dong comparison between n and m value then update m value, so its only given true or false value.
next instruction m==++n, its increment n value as 103 and compare with m, again its give Boolean value.
last instruction only print statement its print n and m value
What is the output of the program? int n=f,m; n==m++; m==++n; printf(n, m);
Related Answered Questions
Related Open Questions