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 23256

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 14893

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 27856

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 6841

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 13129

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 7622

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


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

Cisco, HCL,

3 15715

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

1 15633

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

1 17156

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

2 11606

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

2 8508

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

1 6960

main() { main(); }

1 3885

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

1 11478


Un-Answered Questions { Code Snippets }

How to add flash or *.gif file in edit panel in java?

2098


Write a python program to check if a number is an armstrong number?

613


Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

3300


what is main difference between array_push and array_pop?

3934


Definition of priority queue was given. We have to implement the priority queue using array of pointers with the priorities given in the range 1..n. The array could be accessed using the variable top. The list corresponding to the array elements contains the items having the priority as the array index. Adding an item would require changing the value of top if it has higher priority than top. Extracting an item would require deleting the first element from the corresponding queue. The following class was given: class PriorityQueue { int *Data[100]; int top; public: void put(int item, int priority); // inserts the item with the given priority. int get(int priority); // extract the element with the given priority. int count(); // returns the total elements in the priority queue. int isEmpty(); // check whether the priority queue is empty or not. }; We had to implement all these class functions.

4671


Code for Adding Scripting Support to an Application?

1380


how to pass data between pages using Cookies

2106


What are the basic rules while writing XML?

420


solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)

3188


Dear sirs, Hi, I would like to inform you that I want to perform a project using MLP neural network to recognize binary images containing three types of geometric shapes such as squares,rectangels and circles. Furthermore,each image includes only one geometric type. The output of network would be: '1' if the network detects square shape. '2' if the network detects rectangle shape. '3' if the network detects circle shape. '4' if none of these shapes detected. Would you please send me a matlab source code for this project? Your prompt reply would be so appreciated. regards,

1918


What is the functionality of EnumWindows?

546


Sir... please give some important coding questions asked by product companies..

2058


Performance Algorithm A performs 10n2 basic operations and algorithm B performs 300 lg n basic operations. For what value of n does algorithm B start to show its better performance?

7648


Given a table of the form: Product Sold on A 1/1/1980 B 1/1/1980 C 1/1/1980 A 1/1/1980 B 1/1/1980 C 2/1/1980 A 2/1/1980 There are 30 products and 10,000 records of such type. Also the month period during which sales happened is given to u. Write the program to display the result as: Product Month No. of copies A January 12 A February 15 A March 27 B January 54 B February 15 B March 10 C January 37

2459


Given a N by N matrix of both negative and positive integers. Write an efficient algorithm to find the sub-matrix with the largest sum of all the contained elements.

1491