Code Snippets Interview Questions
Questions Answers Views Company eMail

main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(“%u %u %u %d \n”,a,*a,**a,***a); printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1); }

2 22482

main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) { printf(“%d” ,*a); a++; } p = a; for(j=0; j<5; j++) { printf(“%d ” ,*p); p++; } }

1 14326

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); }

Persistent,

2 26390

main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }

1 6366

main( ) { void *vp; char ch = ‘g’, *cp = “goofy”; int j = 20; vp = &ch; printf(“%c”, *(char *)vp); vp = &j; printf(“%d”,*(int *)vp); vp = cp; printf(“%s”,(char *)vp + 3); }

1 12614

main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }

1 6767

main() { int i, n; char *x = “girl”; n = strlen(x); *x = x[n]; for(i=0; i 2 8568


int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }

Cisco, HCL,

3 14725

main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }

1 15047

What are the files which are automatically opened when a C file is executed?

1 16402

what will be the position of the file marker? a: fseek(ptr,0,SEEK_SET); b: fseek(ptr,0,SEEK_CUR);

2 10939

main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?

2 7938

What is the problem with the following code segment? while ((fgets(receiving array,50,file_ptr)) != EOF) ;

1 6443

main() { main(); }

1 3465

main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }

1 10847


Un-Answered Questions { Code Snippets }

What is XPath in XML?

364


Who is responsible for XML?

366


write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation

2390


What is an attribute?

355


find level of following tree (state, parent) " J,D I,D H,C E,B F,B G,C B,A D,A C,A A,& K,E L,E L,F M,F N,G O,H P,I P,H Q,I R,J S,K U,P T,L

1998






How to Split Strings with Regex in Managed C++ Applications?

3104


Why XSLT is important for XML?

395


I need your help, i need a Turbo C code for this problem.. hope u'll help me guys.? Your program will have a 3x3 array. The user will input the sum of each row and each column. Then the user will input 3 values and store them anywhere, or any location or index, temporarily in the array. Your program will supply the remaining six (6) values and determine the exact location of each value in the array. Example: Input: Sum of row 1: 6 Sum of row 2: 15 Sum of row 3: 24 Sum of column 1: 12 Sum of column 2: 15 Sum of column 3: 18 Value 1: 3 Value 2: 5 Value 3: 6 Output: Sum of Row 1 2 3 6 4 5 6 15 7 8 9 24 Sum of Column 12 15 18 Note: Your program will not necessary sort the walues in the array Thanks..

2801


i am trying to intigrate ejb and hibernate ,from session facade i am callind dao implemented through hibernate,i am getting a ClassDefNotFoundException for this org/hibernate/Session i ve set the class path at build path and in setEnv in weblogic still .........

1968


How to print sum of the numbers starting from 1 to 100?

436


How to change winform look?

2324


Write code to make an object work like a 2-d array?

472


What is a cdata section in xml?

322


write a function that reverse the elements of an array in place.The function must accept only one pointer value and return void.

3945


What are the basic rules while writing XML?

321