squeeze ur brain

what is the o/p:

char a='a';
printf("%d %d",sizeof(a),sizeof('a'));

Replies

  • sristi
    sristi
    i guesso/p will be 2 and 1since printf executes 4m left to right ..sizeof('a') =1 byte..sizeof a char and sizeof(a)=2 bytes
  • pad
    pad
    ish_nalini
    what is the o/p:

    char a='a';
    printf("%d %d",sizeof(a),sizeof('a'));

    answer is architecture dependant.

    sizeof (datatype) are always architecture dependant.... unless you use virtual machines like JVM.
  • mahul
    mahul
    yeah pad is right this gotta depend on compiler and architecture
  • Yamini L
    Yamini L
    i think it would be 2 and 1...for int 2bytes and for char 1 byte...that also depends on the architecture of ur system
  • ambuja 28
    ambuja 28
    we cant write sizeof() inside printf .so it 'll give error
  • sattu21
    sattu21
    the answer wud be
    1 1
  • pallavi agarwal
    pallavi agarwal
    according 2 me the answer wud be 1 1 & also there is no need to give char a='a' ,we can simply give char a coz thats not making any difference basically.
  • friendster7
    friendster7
    the answer will be 1 and 1 too.and we can write sizeof() in printf their will be no error.

You are reading an archived discussion.

Related Posts

How can i change a rar. name file type to other? i'm not able to see it . It is a downloaded file with extension rar.
[FONT=verdana,geneva]CEans! CrazyEngineers is proud to have Dan Kuykendall (Director Of Engineering, NTObjectives Inc., USA) – the man behind Mighty Seek Podcast, podPress, project - phpGroupWare, rpmBuilder, Qmail & podcastAlley! Few...
hi everybody,this is my very first thread on this site and i hope i could get the answer of my questions......... my question is that "is there any way to...
who would u think is the ICON of the year 2006? hey everyone, the debate is on "the Icon of the year ".i am not pin pointing the "youth icon"(mind...
Why 555 Timer Is So Called As?that's A Very Common Question But I Didn't That In Book.so Help Me Out