Un-Answered Questions { Programming Languages }

What is spaghetti programming?

674


Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].

648


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

635


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

839


Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.

667


GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

688


Explain about templates of C++.

680


What is different in C++, compare with unix?

611


I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.

614


Discussion on error handling of C++ .

650


What are the unique features of C++.

575


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

741


the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b

1908


which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above

1421


a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above

687