| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| code snippet for creating a pyramids triangle
ex
1
2 2
3 3 3 | | 3 |
| n=7623
{
temp=n/10;
result=temp*10+ result;
n=n/10
}
| Wipro | 4 |
| In the following code segment what will be the result of the
function,
value of x , value of y
{
unsigned int x=-1;
int y;
y = ~0;
if(x == y)
printf("same");
else
printf("not same");
}
a) same, MAXINT, -1
b) not same, MAXINT, -MAXINT
c) same , MAXUNIT, -1
d) same, MAXUNIT, MAXUNIT
e) not same, MAXINT, MAXUNIT
| IBM | 1 |
| Print all the palindrome numbers.If a number is not
palindrome make it one by attaching the reverse to it.
eg:123
output:123321 (or) 12321 | | 2 |
| Determine if a number is a power of 2 at O(1). | | 1 |
| totally how much header files r in c language | TCS | 4 |
| int main()
{
int *p=new int;
*p=10;
del p;
cout<<*p;
*p= 60;
cout<<*p;
}
what will be the output & why? | TCS | 4 |
| Toggle nth bit in a given integer - num | Qualcomm | 2 |
| 9.how do you write a function that takes a variable number
of arguments? What is the prototype of printf () function?
10.How do you access command-line arguments?
11.what does ‘#include<stdio.h>’ mean?
12.what is the difference between #include<> and #include”…”?
13.what are # pragma staments?
14.what is the most appropriate way to write a
multi-statement macro? | | 1 |
| How can I return multiple values from a function? | | 4 |
| How can I prevent other programmers from violating
encapsulation by seeing the private parts of my class? | | 1 |
| Which of the following sorts is quickest when sorting the
following set: 1 2 3 5 4
1) Quick Sort
2) Bubble Sort
3) Merge Sort
| | 5 |
| long int size
a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes
| HCL | 11 |
| why i join syntel? | Syntel | 12 |
| CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION. | | 6 |
| what is object oriental programing? | | 1 |
| hi how to convert program from notepad to turboc editor can
u please help me | | 1 |
| How to write a program for swapping two strings without
using 3rd variable and without using string functions. | iGate | 5 |
| what is the difference between declaration and definition
of a variable or function ? | | 2 |
| value = 0xabcd;
for (loop = 1; (value >> 1) & 1 | loop & 1; loop++) {
foo();
if (loop & 1)
value >>= 1;
}
how many times is foo() executed? | Google | 5 |
| |
| For more C Interview Questions Click Here |