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 |
main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }
main() { int x=5; for(;x!=0;x--) { printf("x=%d\n", x--); } } a. 5, 4, 3, 2,1 b. 4, 3, 2, 1, 0 c. 5, 3, 1 d. none of the above
main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }
PROG. TO PRODUCE 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
What are segment and offset addresses?
write a program in c to merge two array
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
main() { static char names[5][20]={"pascal","ada","cobol","fortran","perl"}; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for (i=0;i<=4;i++) printf("%s",names[i]); }
# include <stdio.h> int one_d[]={1,2,3}; main() { int *ptr; ptr=one_d; ptr+=3; printf("%d",*ptr); }
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?