[algogeeks] plz explain output y it is 1212

2012-08-17 Thread Shubham Sandeep
#includestdio.h main() { printf ( \%\d\ , 12 ) ; printf ( \%\ d\ , 12 ) ; } -- Regards, SHUBHAM SANDEEP IT 3rd yr. NIT ALD. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] plz explain output y it is 1212

2012-08-17 Thread gaurav yadav
Hi..please repost your code after properly formatting ...it is not readable...and throws compilation errors. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from

Re: [algogeeks] Plz Explain the working

2011-10-03 Thread Shuaib
Chk is a macro that gets replaced with an if statement. The else part gets attached to the most recent if which is the one from the macro. And since the condition in macro fails, the else clause is executed. -- Shuaib http://twitter.com/ShuaibKhan http://www.bytehood.com/ On 03-Oct-2011, at

Re: [algogeeks] Plz Explain the working

2011-10-03 Thread ~*~VICKY~*~
@Shauib: cool soln. Thank you. On Mon, Oct 3, 2011 at 6:14 PM, Shuaib aries.shu...@gmail.com wrote: Chk is a macro that gets replaced with an if statement. The else part gets attached to the most recent if which is the one from the macro. And since the condition in macro fails, the else

Re: [algogeeks] Plz Explain the working

2011-10-03 Thread Prakash D
+1 On Mon, Oct 3, 2011 at 6:40 PM, ~*~VICKY~*~ venkat.jun...@gmail.com wrote: @Shauib: cool soln. Thank you. On Mon, Oct 3, 2011 at 6:14 PM, Shuaib aries.shu...@gmail.com wrote: Chk is a macro that gets replaced with an if statement. The else part gets attached to the most recent if which

Re: [algogeeks] Plz explain the output..........

2011-09-17 Thread praveen raj
This will show syntax error due to x==9 and otherwise since memory address given at the declarAtion there fore x value will. Change at every assignment , but i m not sure printf will give an error or not . Plz reply. On 17-Sep-2011 1:13 AM, Anshul AGARWAL anshul.agarwa...@gmail.com wrote:

Re: [algogeeks] Plz explain the output..........

2011-09-17 Thread Yogesh Yadav
x==9 is not an error... it will be 1 when true and 0 when false...and both are executable statements... when we print float with %d then compiler prints 0...and when we print integer with %f then compiler prints last assigned or printed float value to any float variablehere it is assigned

Re: [algogeeks] Plz explain the output..........

2011-09-17 Thread sukran dhawan
x== 9 is not an error !!! it simply returns a non zero value if its true and 0 if its false On Sat, Sep 17, 2011 at 11:39 AM, praveen raj praveen0...@gmail.com wrote: This will show syntax error due to x==9 and otherwise since memory address given at the declarAtion there fore x value will.

Re: [algogeeks] Plz explain the output..........

2011-09-17 Thread abhinav gupta
@yogesh :ya u right. On Sat, Sep 17, 2011 at 11:58 AM, sukran dhawan sukrandha...@gmail.comwrote: x== 9 is not an error !!! it simply returns a non zero value if its true and 0 if its false On Sat, Sep 17, 2011 at 11:39 AM, praveen raj praveen0...@gmail.comwrote: This will show syntax

Re: [algogeeks] Plz explain the output..........

2011-09-17 Thread Ashima .
@yogesh : but if in place of x=1 in above code, I write t=54. that means i m assigning somevalue to a float variable.Then it should print 54 afterwards. but its again printing 98. how does it go with ur concept. Ashima M.Sc.(Tech)Information Systems 4th year BITS Pilani Rajasthan On Fri, Sep

Re: [algogeeks] Plz explain the output..........

2011-09-17 Thread Yogesh Yadav
@Ashima.. u r right...it is always printing first float variable value On Sat, Sep 17, 2011 at 2:05 PM, Ashima . ashima.b...@gmail.com wrote: @yogesh : but if in place of x=1 in above code, I write t=54. that means i m assigning somevalue to a float variable.Then it should print 54

[algogeeks] Plz explain the output..........

2011-09-16 Thread Anshul AGARWAL
#includestdio.h int main() {float t; long x; t=98; printf(%d\n,t); printf(%f\n,x); { x=1; printf(%f\n,x); { x=30; printf(%f\n,x); } printf(%f\n,x); } x==9; printf(%f\n,x); }

Re: [algogeeks] Plz explain the output..........

2011-09-16 Thread sukran dhawan
Printing a floating point with %d conversion specifier will not print the expected resultss ! On Sat, Sep 17, 2011 at 1:13 AM, Anshul AGARWAL anshul.agarwa...@gmail.comwrote: #includestdio.h int main() {float t; long x; t=98; printf(%d\n,t); printf(%f\n,x); {

Re: [algogeeks] plz explain

2011-08-01 Thread kartik sachan
i think this will be the only solution -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For

[algogeeks] plz explain

2011-07-31 Thread shiv narayan
Mike has $20 more than Todd. How much does each have given that combined they have $21 between them. You can't use fractions in the answer. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] plz explain

2011-07-31 Thread aditi garg
well lets say its ruppees... mike has Rs20.50 and Todd Rs .50 condition 1 satisfied for condition 2. mike has 2050 paise and mike 50 paise...(P.S its not in fractions) I know u must be thinking im stupid bt i have read dis in sm book and dis is wat the ans dey had gvn...:) On Sun, Jul 31,

[algogeeks] plz explain if the solution is possible with less than 2n-3 comparisons??

2011-07-13 Thread shiv narayan
Describe an optimal algorithm to find the second minimum number in an array of numbers. What is the exact number of comparisons required in the worst case? Note that they didn't ask the order in Big-Oh notation. They wanted the exact number of comparisons. -- You received this message because

Re: [algogeeks] plz explain if the solution is possible with less than 2n-3 comparisons??

2011-07-13 Thread sunny agrawal
n+lgn-2 no of comparisions will do On Thu, Jul 14, 2011 at 10:19 AM, shiv narayan narayan.shiv...@gmail.comwrote: Describe an optimal algorithm to find the second minimum number in an array of numbers. What is the exact number of comparisons required in the worst case? Note that they didn't

Re: [algogeeks] plz explain if the solution is possible with less than 2n-3 comparisons??

2011-07-13 Thread shady
use radix sort... and the answer is 0. ;) On Thu, Jul 14, 2011 at 10:52 AM, sunny agrawal sunny816.i...@gmail.comwrote: n+lgn-2 no of comparisions will do On Thu, Jul 14, 2011 at 10:19 AM, shiv narayan narayan.shiv...@gmail.comwrote: Describe an optimal algorithm to find the second

Re: [algogeeks] Plz Explain The Output.

2011-01-02 Thread juver++
char type is signed by default, so it represents value 255 as -1. Code outputs first byte as unsigned int value, where -1 == 4294967295. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] Plz Explain The Output.

2011-01-01 Thread Aniket
# include stdio.h #includeconio.h #define concatinate(a,b) a##b #define same1(a) #a #define same2(a) same1(a) int main(){ printf(%s\n,same2(concatinate(1,2))); printf(%s\n,same1(concatinate(1,2))); getch(); return 0; } Output is: 12 concatinate(1,2) -- You received this message because you

Re: [algogeeks] Plz Explain The Output.

2011-01-01 Thread aniket chatterjee
2. #includeiostream using namespace std; int main(){ int n = 255, i; char *p = (char *)n; for(i = 0; i sizeof(int); i++) cout(unsigned int)p[i]\n; cin.get(); return 0; } Output: 4294967295 0 0 0 I think p[0] is .So why it is giving 4294967295 in the first line. -- You received this

Re: [algogeeks] plz explain output

2010-10-13 Thread dinesh bansal
check http://en.wikipedia.org/wiki/NaN On Sat, Oct 9, 2010 at 6:15 PM, ankush jainankus...@gmail.com wrote: #includestdio.h void main() { int x; float t; scanf(%f,t); printf(%f\n,t); x=90; printf(%f\n,x); { x=1;

Re: [algogeeks] plz explain output

2010-10-13 Thread Lily Aldrin
How is the link you gave related to the output question here?? On Wed, Oct 13, 2010 at 7:20 PM, dinesh bansal bansal...@gmail.com wrote: check http://en.wikipedia.org/wiki/NaN On Sat, Oct 9, 2010 at 6:15 PM, ankush jainankus...@gmail.com wrote: #includestdio.h void main() { int x;

[algogeeks] plz explain output

2010-10-09 Thread ankush
#includestdio.h void main() { int x; float t; scanf(%f,t); printf(%f\n,t); x=90; printf(%f\n,x); { x=1; printf(%f\n,x); { x=30; printf(%d\n,x);

Re: [algogeeks] plz explain output

2010-10-09 Thread Ashutosh Tripathi
hey! i am also unable to explain but one thing i got if we use %d in place of %f,we will get the correct output. we must use %d as x is of int data type.so thq code is itself wrong. or u can change x to float data type -- Ashutosh Tripathi UG Student Computer