i=300 // binary = 0001 00101100
// in case of little Endien
it will be saved like this :-
0001
00101100
//suppose int = 2 bytes and char = 1 byte
char *ptr = i; // take care it *char *ptr* not *int* **ptr*so what
will happen
*ptr will be pointing to 00101100
*++ptr // now ptr is
A: 556
--
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 more options, visit this group
Hahaha.. Xcellent question Dude.. People Who Know can easily explain.. So
for who don't here it is..
It has nothing to do with Endianess Mr.Yogesh.. Actually the bit patter
happens to be reside such that ob.ch[0] fills with all ones ..
Now as we knw the sign bit concept , here compilers goes mad
Sign bit.
well i forgot abt that. Bro still nly 1 bit s taken for sign so nly 1 '1' s
taken as determining sign to be negative. Still we have 7 1's in hand.
Wat abt that ?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
http://ideone.com/Zz7ET
On Thu, Jun 7, 2012 at 12:27 AM, g4ur4v gauravyadav1...@gmail.com wrote:
main()
{
int i=300;
char *ptr = i;
*++ptr=2;
printf(%d,i);
}
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
15 times
On Sat, Aug 6, 2011 at 7:20 PM, abhishek abhishek.ma...@gmail.com wrote:
int x=150
for(y=x;y0;y=(x(y-1))
printf(Hi, There);
How many times hi there will be printed?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to
@kartik : can u explain hw it is coming?
On Sat, Aug 6, 2011 at 8:33 PM, karthik loganathan
karthik.algog...@gmail.com wrote:
15 times
On Sat, Aug 6, 2011 at 7:20 PM, abhishek abhishek.ma...@gmail.com wrote:
int x=150
for(y=x;y0;y=(x(y-1))
printf(Hi, There);
How many times hi there
2
On Sat, Jul 16, 2011 at 2:51 PM, shiv narayan narayan.shiv...@gmail.comwrote:
Printf(“%d”,printf(“%d %d”,2,2) printf(“%d %d ”, 2, 2));
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
what about this
printf(\n%d,printf(%d %d,2,2)printf(%d%d ,2,2));
On Sat, Jul 16, 2011 at 3:04 PM, swetha rahul swetharahu...@gmail.comwrote:
2
On Sat, Jul 16, 2011 at 2:51 PM, shiv narayan
narayan.shiv...@gmail.comwrote:
Printf(“%d”,printf(“%d %d”,2,2) printf(“%d %d ”, 2, 2));
Well if there is a space btween the two %d's dn it should be 2 2 2 23
Otherwise fine.
On Sat, Jul 16, 2011 at 3:08 PM, Deoki Nandan deok...@gmail.com wrote:
what about this
printf(\n%d,printf(%d %d,2,2)printf(%d%d ,2,2));
On Sat, Jul 16, 2011 at 3:04 PM, swetha rahul
answer for first should be
2 22 23
and for second
2 222
2
correct me if i am wrong.
On Sat, Jul 16, 2011 at 3:08 PM, Deoki Nandan deok...@gmail.com wrote:
what about this
printf(\n%d,printf(%d %d,2,2)printf(%d%d ,2,2));
On Sat, Jul 16, 2011 at 3:04 PM, swetha rahul
@ankur that's right :)
On Sat, Jul 16, 2011 at 3:25 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote:
answer for first should be
2 22 23
and for second
2 222
2
correct me if i am wrong.
On Sat, Jul 16, 2011 at 3:08 PM, Deoki Nandan deok...@gmail.com wrote:
what about this
the ans to first should be 2 2 2 2 0.
and the and to second should be.
222 2
2
please correct me if i am wrong.
On Sat, Jul 16, 2011 at 4:57 PM, shady sinv...@gmail.com wrote:
@ankur that's right :)
On Sat, Jul 16, 2011 at 3:25 PM, Ankur Khurana
ankur.kkhur...@gmail.comwrote:
answer for
please ignore my previous post.
On Sat, Jul 16, 2011 at 5:38 PM, varun pahwa varunpahwa2...@gmail.comwrote:
the ans to first should be 2 2 2 2 0.
and the and to second should be.
222 2
2
please correct me if i am wrong.
On Sat, Jul 16, 2011 at 4:57 PM, shady sinv...@gmail.com wrote:
ignore my previous result.
the ans to first should be 2 22 2 0.
and the ans to second should be.
2 222
2
please correct me if i am wrong.
On Sat, Jul 16, 2011 at 5:38 PM, varun pahwa varunpahwa2...@gmail.comwrote:
the ans to first should be 2 2 2 2 0.
and the and to second should be.
222 2
answer to the first should be 2 22 23
On Sat, Jul 16, 2011 at 5:44 PM, varun pahwa varunpahwa2...@gmail.comwrote:
ignore my previous result.
the ans to first should be 2 22 2 0.
and the ans to second should be.
2 222
2
please correct me if i am wrong.
On Sat, Jul 16, 2011 at 5:38 PM,
Give reason not answer . Answer can be found by compiler
On Sun, Jul 17, 2011 at 12:38 AM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:
answer to the first should be 2 22 23
On Sat, Jul 16, 2011 at 5:44 PM, varun pahwa varunpahwa2...@gmail.comwrote:
ignore my previous result.
the ans
printf returns no of characters printed..first of all the rightmost printf
will print 2 2 .and since it is printing 3 characters(two 2's and 1 space)
thereby its returning 3.same is with the other printf..now the outer most
printf will print the value of(3 3) which is 3..and hence the answer.
On
8, 32, 96
On Sat, Feb 5, 2011 at 2:46 PM, priya mehta priya.mehta...@gmail.comwrote:
#include stdio.h
#define PrintInt(expr) printf(%s : %d\n,#expr,(expr))
*int* FiveTimes(*int* a)
{
*int* t;
t *=* a**2 *+* a;
*return* t;
}
*int* main()
{
*int*
because u not thinking of operator precedence :P :P
On Sat, Feb 5, 2011 at 2:52 PM, priya mehta priya.mehta...@gmail.comwrote:
why is this happening?
On Sat, Feb 5, 2011 at 2:51 PM, Manmeet Singh mans.aus...@gmail.comwrote:
8, 32, 96
On Sat, Feb 5, 2011 at 2:46 PM, priya mehta
@priya u seems to be a beginner in c programming...
I would suggest u to go through Dennis richie.
Thanks and regards,
Gajendra Dadheech
On Sat, Feb 5, 2011 at 2:53 PM, Manmeet Singh mans.aus...@gmail.com wrote:
because u not thinking of operator precedence :P :P
On Sat, Feb 5, 2011
sure thanks:)
On Sat, Feb 5, 2011 at 6:26 PM, Gajendra Dadheech gajju3...@gmail.comwrote:
@priya u seems to be a beginner in c programming...
I would suggest u to go through Dennis richie.
Thanks and regards,
Gajendra Dadheech
On Sat, Feb 5, 2011 at 2:53 PM, Manmeet Singh
@priya Because precedence of + operator is greater than operator . So
evaluation of expression a 2 + a will be
a(a+2)
On Sat, Feb 5, 2011 at 6:35 PM, priya mehta priya.mehta...@gmail.comwrote:
sure thanks:)
On Sat, Feb 5, 2011 at 6:26 PM, Gajendra Dadheech gajju3...@gmail.comwrote:
12
and
f(1,2)
On Sat, Feb 5, 2011 at 12:46 AM, priya mehta priya.mehta...@gmail.comwrote:
#include stdio.h
#define f(a,b) a*##*b
#define g(a) *#*a
#define h(a) g(a)
*int* main()
{
printf(%s\n,h(f(1,2)));
printf(%s\n,g(f(1,2)));
*return* 0;
thats amazing :) :)
but i wanted to know the explanation dear.
On Sat, Feb 5, 2011 at 12:49 AM, rajat ahuja catch.rajatah...@gmail.comwrote:
12
and
f(1,2)
On Sat, Feb 5, 2011 at 12:46 AM, priya mehta priya.mehta...@gmail.comwrote:
#include stdio.h
#define f(a,b) a*##*b
#define
ohk
i try to xplain ,
first u understand abt two macros operator
# operator makes string
like
#define g(a) *#*a
WTEVER value of a will come ,this operator wil convert that into string
noe 2nd operator
is concatenation one
like
#define f(a,b) a*##*b
here a and b wil get concatenated to form
answer will be -1
because the statement in while loop will never executed
as (+(+0)!=0)
this will be evaluated as false because zero is not equal to zero
and i is decremented in here but decrementation is postfix uses the value
first and decrement it after sequence point which is the condition
27 matches
Mail list logo