Code Snippets Interview Questions
Questions Answers Views Company eMail

main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }

1 5181

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

2 15687

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

3 6174

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

3 6112

#include main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }

1 5256

main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }

IBM,

2 11992

#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }

3 19228

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

Zoho,

1 20752

#include main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }

CNSI,

2 11845

#include main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }

TCS,

1 8521

#include main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

2 11355

main() { extern int i; i=20; printf("%d",sizeof(i)); }

2 22144

main() { printf("%d", out); } int out=100;

3 11988

main() { extern out; printf("%d", out); } int out=100;

1 9382

main() { show(); } void show() { printf("I'm the greatest"); }

2 12914


Un-Answered Questions { Code Snippets }

Code for Adding Scripting Support to an Application?

1380


Pls provide basic funtionality Winrunner scripts for Health care domain and Phishing

1150


how to Auto Scroll the page

1801


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

2320


How we work on N tire architecture in asp.net Please give me Examle...

17100


Write a python program to find the second largest number in a list?

634


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

2078


Write a function to efficiently convert a floating point number to a rational number. For example, given 0.125 return "1/8"

1323


What is full form of PEPSI

2134


What are the features of XML?

455


how to use the GetTickCount() properly and what is that procedure for?

2913


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.

4643


Write a Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)

648


How to find No of classes,Packages,No of Methods per Classes and Depth of Inheritance for selecting source code in windows form application using c# .net? (Source code is input Program. It may be Java or .net) Please help me..) Thanks..)

2446


What is XML Element?

498