int array[]={1,2,3,4,5,6,7,8}; #define SIZE (sizeof(array)/sizeof(int)) main() { if(-1<=SIZE) printf("1"); else printf("2"); }
2 28191struct tag{ auto int x; static int y; };main() { struct tag s; s.x=4; s.y=5; printf(“%d”,s.x); }
2 13511main() { struct test { char c; int i; char m; } t1; printf("%d %d\n", sizeof(t1), sizeof(t1.c)); }
1 9608main() { unsigned int k = 987 , i = 0; char trans[10]; do { trans[i++] =(char) (k%16 > 9 ? k%16 - 10 + 'a' : '\0' ); } while(k /= 16); printf("%s\n", trans); }
4 13929main() { FILE *fs; char c[10]; fs = fopen(“source.txt”, ”r”); /* source.txt exists and contains “Vector Institute” */ fseek(fs,0,SEEK_END); fseek(fs,-3L,SEEK_CUR); fgets(c,5,fs); puts(c); }
1 10174main() { char as[] = "\\0\0"; int i = 0; do{ switch( as[i++]) {case '\\' : printf("A"); break; case 0 : printf("B"); break; default : printf("C"); break; }} while(i<3); }
4 11331#define MAX 3 main() { printf("MAX = %d \n",MAX ); #undef MAX #ifdef MAX printf("Vector Institute”); #endif
4 29459main() { int a[3][4] ={1,2,3,4,5,6,7,8,9,10,11,12} ; int i, j , k=99 ; for(i=0;i<3;i++) for(j=0;j<4;j++) if(a[i][j] < k) k = a[i][j]; printf("%d", k); }
4 24878main() { enum _tag{ left=10, right, front=100, back}; printf("%d, %d, %d, %d", left, right, front, back); }
1 9902Post New Vector C Interview Questions
What are different types of JOINS in SAP HANA?
What is the extension of a compiled help project file?
Why is polymorphism used?
What do you mean by 'additional insured'? : insurance sales
What are the different classes used in visual tree?
What is the relation between α & β?
Do the attributes get added to content (actual data) when data is pulled by nifi ?
How to use regular expression in pattern match conditions?
What does webkit mean in css?
What is user-defined functions? What are the types of user-defined functions that can be created?
Why does the system not calculate variance for the 500 kgs which has been delivered?
How much cement,sand,bricks and water needed for 1square metre brick work?
How range and azimuth is calculating in RADAR
Why you need class group?
What is rpa? Clarify the significance of rpa.