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
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 |
Write a routine that prints out a 2-D array in spiral order
main() { char c; int i = 456; clrscr(); c = i; printf("%d", c); } a. 456 b. -456 c. random number d. none of the above
int a=1; printf("%d %d %d",a++,a++,a); need o/p in 'c' and what explanation too
int main() { int x=10; printf("x=%d, count of earlier print=%d", x,printf("x=%d, y=%d",x,--x)); getch(); } ================================================== returns error>> ld returned 1 exit status =================================================== Does it have something to do with printf() inside another printf().
main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); } a. Runtime error. b. 0, 0 c. Compile error d. the first two values entered by the user
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
#include <stdio.h> main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr<least ) ?*ptr :least; printf("%d",least); }
main() { int i; clrscr(); for(i=0;i<5;i++) { printf("%d\n", 1L << i); } } a. 5, 4, 3, 2, 1 b. 0, 1, 2, 3, 4 c. 0, 1, 2, 4, 8 d. 1, 2, 4, 8, 16
main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }
Is the following code legal? typedef struct a { int x; aType *b; }aType
main() { char *str1="abcd"; char str2[]="abcd"; printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd")); }
Sorting entire link list using selection sort and insertion sort and calculating their time complexity
1 Answers Infosys, Microsoft, NetApp,