Code Snippets Interview Questions
Questions Answers Views Company eMail

int swap(int *a,int *b) { *a=*a+*b;*b=*a-*b;*a=*a-*b; } main() { int x=10,y=20; swap(&x,&y); printf("x= %d y = %d\n",x,y); }

1 1952

main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }

IBM, TCS, Wipro, UGC NET,

29 18828

main() { int i=5; printf("%d",++i++); }

1 1479

main() { char *p = “ayqm”; char c; c = ++*p++; printf(“%c”,c); }

1 2140

int aaa() {printf(“Hi”);} int bbb(){printf(“hello”);} iny ccc(){printf(“bye”);} main() { int ( * ptr[3]) (); ptr[0] = aaa; ptr[1] = bbb; ptr[2] =ccc; ptr[2](); }

1 2528

main() { int i=5; printf(“%d”,i=++i ==6); }

1 1450

main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }

2 3868

void ( * abc( int, void ( *def) () ) ) ();

1 2107

main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }

1 2380

main() { char str1[] = {‘s’,’o’,’m’,’e’}; char str2[] = {‘s’,’o’,’m’,’e’,’\0’}; while (strcmp(str1,str2)) printf(“Strings are not equal\n”); }

1 1855

main() { int i = 3; for (;i++=0;) printf(“%d”,i); }

CSC,

1 4702

void main() { int *mptr, *cptr; mptr = (int*)malloc(sizeof(int)); printf(“%d”,*mptr); int *cptr = (int*)calloc(sizeof(int),1); printf(“%d”,*cptr); }

1 1660

void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }

2 4724

main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }

CSC,

2 8847

1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.

3 2048



Un-Answered Questions { Code Snippets }

how to create an anonymous function

780


I have a file which contains so many lines and variable number of lines are treated as a record. For example *first ooooo xxxxx ttttt mmmm vvvvvvv *end uuu bbbb *first kkkkvvvvvv nnnn mmmmm kkkkk fffff gggg ffff kkkk lllll *end. Here the lines from *first to *end are treated as a record. The number of lines between *first and *end is not same for all the records. Suppose there are 100 records (or number of records are not predefined)like the format given in the above example. Now the entire file needs to split into two files, first having 40 and remaining in the second file. Can we split using sort utility? If possible then what is the sort card?

885


What is the best way to make wordpress plugin

1688


Write a function that takes an integer and returns the smallest number that is greater than the given number which is a palendrome. For example, if the input was 111 the next palindromic number would be 121.

341


what is main difference between array_push and array_pop?

1869


write a program in java to find the moving average of all prime numbers between 2 and 100.

2199


i have a gird with columns all are coming from database,this will bind in item templete in gridview as textboxex.and i have button below named Update.i want to update all the records in the grid,but if user change the value of one textbox,what is the easy way 2 do this

1151


What is the functionality of FindWindow?

295


how to convert between arrays and strings

1173


Cluster head selection in Wireless Sensor Network using C programming language.

1322


code to Hide and Show form controls

819


What is data _null_? ,Explain with code when u need to use it in data step programming ?

1378


Given a circular list of integers (when you reach the end of the list you come back to the beginning), what is the most efficient algorithm to find the smallest integer in the list? For example: circular_list = [22, 52, 66, 82, 5, 8, 12, 19].

356


How to change winform look?

1408


Coding for Synchronizing Cache Access in ASP.NET?

1733