Archive for the 'Interviews Stuff' Category
IT Companies in Chennai
Wednesday, May 7th, 2008Interview questions on Bitwise Operators
Wednesday, May 7th, 20081)Which bit wise operator is suitable for turning off a particular bit in a number?
2)what will be printed out when the following code is executed:
main()
{
printf(”%x”,-1<<4);
}
3)Which one is equivalent to multiplying by 2?
* Left shifting a number by 1
* Left shifting an unsigned int or char by 1?
4)Write a function which gets the n bits from […]
Basic C Questions to test ur expertise -11
Wednesday, May 7th, 20081.
Sample Code
#include
int main(void) {
{int i=10; goto lbl;}
{int i=20; {int i=30; lbl:;}
printf(”%i”, ++i);}
}
Refer to the above sample code. What does this program print?
1 10
2 11
3 21
4 31
5 An undefinedvalue
2.
short testarray[4][3] = { {1}, {2, 3}, {4, 5, 6} };
printf( […]
Basic C Questions to test ur expertise -10
Wednesday, May 7th, 2008 What are advantages and disadvantages of external storage class?
Advantages of external storage class
1)Persistent storage of a variable retains the latest value
2)The value is globally available
Disadvantages of external storage class
1)The storage for an external variable exists even when the variable is not needed
2)The side effect may produce surprising output
3)Modification of the program is […]
Basic C Questions to test ur expertise -9
Wednesday, May 7th, 2008Are pointers integers?
No, pointers are not integers.A pointer is an address.It is merely a positive number and not an integer.
How do you redirect a standard stream?
Most operating systems, including DOS, provide a means to redirect program input and output to and from different devices. This means that rather than your […]
Basic C Questions to test ur expertise -8
Wednesday, May 7th, 2008 What is the benefit of using const for declaring constants?
The benefit of using the const keyword is that the compiler might be able to make optimizations based on the knowledge that the value of the variable will not change. In addition, the compiler will try to ensure that the values won’t be […]
Basic C Questions to test ur expertise -6
Wednesday, May 7th, 2008 Write the equivalent expression for x%8?
x&7
When does the compiler not implicitly generate the address of the first element of an array?
Whenever an array name appears in an expression such as
- array as an operand of the sizeof operator
- array as an operand of & operator
- array as […]
Basic C Questions to test ur expertise-5
Wednesday, May 7th, 2008The answer depends on what you mean by quickest. For most sorting problems, it just doesn’t matter how quick the sort is because it is done infrequently or other operations take significantly more time anyway. Even in cases in which sorting speed is of the essence, there is no one answer. It depends on […]
Basic C Questions to test ur expertise-4
Wednesday, May 7th, 2008Why does malloc(0) return valid memory address ? What’s the use ?
malloc(0) does not return a non-NULL under every implementation.
An implementation is free to behave in a manner it finds
suitable, if the allocation size requested is zero. The
implmentation may choose any of the following actions:
* A null pointer is returned.
* The behavior is same […]

