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 . 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 > afterwards. > but its ag

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 1

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

2011-09-16 Thread abhinav gupta
@yogesh :ya u right. On Sat, Sep 17, 2011 at 11:58 AM, sukran dhawan wrote: > 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 wrote: > >> This will show syntax error due to x==9 and otherwise since

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

2011-09-16 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 wrote: > 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 > ass

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

2011-09-16 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 for

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

2011-09-16 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" wrote: > > #include > int main() > {fl

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 wrote: > #include > int main() > {float t; > long x; > > > t=98; > printf("%d\n",t); > printf("%f\n",x); > { > x=1; >

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

2011-09-16 Thread Anshul AGARWAL
#include 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-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 algoge...@googlegrou

Re: [algogeeks] Plz Explain The Output.

2011-01-01 Thread aniket chatterjee
2. #include 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 m

[algogeeks] Plz Explain The Output.

2011-01-01 Thread Aniket
# include #include #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 are subscribe