main()

{

int i = 100;

clrscr();

printf("%d", sizeof(sizeof(i)));

}

a. 2

b. 100

c. 4

d. none of the above

Answers were Sorted based on User's Feedback



main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } ..

Answer / guest

a) 2

Is This Answer Correct ?    14 Yes 1 No

main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } ..

Answer / rakesh

ans will depend upon the compiler being used
if it c then it's (a)

Is This Answer Correct ?    9 Yes 3 No

main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } ..

Answer / sandeep

answer :


a> 2

becase sizeof method return the size of passed
arguments's data type

Is This Answer Correct ?    5 Yes 0 No

main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } ..

Answer / karthi

a.2

Is This Answer Correct ?    2 Yes 0 No

main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } ..

Answer / kurt s

sizeof() is a compile-time operator, and it's implementation-specific. Depending on compiler and operating system, it is likely to be either (a) or (c). My desktop machine (Fedora core 13 , 32-bit) returns 4, but my old laptop running Win2000 returns 2.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Code Interview Questions

#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above

3 Answers   HCL,


main( ) { static int a[ ] = {0,1,2,3,4}; int *p[ ] = {a,a+1,a+2,a+3,a+4}; int **ptr = p; ptr++; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); *ptr++; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); *++ptr; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); ++*ptr; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); }

2 Answers   Persistent,


typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }

1 Answers  


main() { char a[4]="HELL"; printf("%s",a); }

3 Answers   Wipro,


Print an integer using only putchar. Try doing it without using extra storage.

2 Answers  






why the range of an unsigned integer is double almost than the signed integer.

1 Answers  


#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }

1 Answers  


Write, efficient code for extracting unique elements from a sorted list of array. e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).

13 Answers   Intel, Microsoft, TCS,


how to print 1 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3 2 1 using any loop(for or while) only once(only 1 loop) and maximum 2 variables using C.

19 Answers   Cap Gemini, Infosys,


main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }

1 Answers  


void main() { printf(“sizeof (void *) = %d \n“, sizeof( void *)); printf(“sizeof (int *) = %d \n”, sizeof(int *)); printf(“sizeof (double *) = %d \n”, sizeof(double *)); printf(“sizeof(struct unknown *) = %d \n”, sizeof(struct unknown *)); }

1 Answers  


Printf can be implemented by using __________ list.

3 Answers  


Categories