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 4867

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 14922

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

3 5641

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

3 5413

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

1 4886

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

IBM,

2 11407

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

3 18373

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

Zoho,

1 20254

#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 11188

#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 8010

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

2 10729

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

2 21389

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

3 11388

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

1 8977

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

2 12357


Un-Answered Questions { Code Snippets }

1.Explain what happens to a session object when the browser associated with it is closed? 2.Explain how a session object is created and used. (Note: you are not required to provide the Java statements such as ‘getAttribute’)

1987


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

1177


What is XML Parser?

452


how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

3129


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

482






How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

2029


Which framework is best in php among Smarty, Cakephp, Joomla, Drupal, Zend or Something else...? If any then Why?

8051


Write a python program to check if a number is a palindrome or not?

452


Write a program that implements a date class containing day, month and year as data members. Implement assignment operator and copy constructor in this class.

547


What output does this program generate as shown? Why? class A { A() { cout << "A::A()" << endl; } ~A() { cout << "A::~A()" << endl; throw "A::exception"; } }; class B { B() { cout << "B::B()" << endl; throw "B::exception"; } ~B() { cout << "B::~B()"; } }; int main(int, char**) { try { cout << "Entering try...catch block" << endl; A objectA; B objectB; cout << "Exiting try...catch block" << endl; } catch (char* ex) { cout << ex << endl; } return 0; }

580


how to Scroll a DIV content

2163


What is GUID anyway?

573


write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used

4310


code to sorting an array of objects

1997


What are the features of XML?

358