| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| write a program to swap Two numbers without using temp variable. | HP | 22 |
| What are the average number of comparisons required to sort
3 elements? | | 2 |
| what is difference between c and c++ | | 3 |
| i want to know aptitude questions,technical questions | | 2 |
| #define MAX(x,y) (x) > (y) ? (x) : (y)
main()
{
int i = 10, j = 5, k = 0;
k = MAX(i++, ++j);
printf("%d %d %d", i,j,k);
}
what will the values of i , j and k?
}
| NDS | 9 |
| Design a program using an array that searches a number if it
is found on the list of the given input numbers and locate
its exact location in the list. | | 3 |
| Evaluate the following:
int fn(int v)
{
if(v==1 || v==0)
return 1;
if(v%2==0)
return fn(v/2)+2;
else
return fn(v-1)+3;
}
for fn(7);
1) 10
2) 11
3) 1
| | 6 |
| What are data breakpoints? | Adobe | 1 |
| write a program to find out number of on bits in a number?
| Huawei | 12 |
| How would you print out the data in a binary tree, level by
level, starting at the top? | Microsoft | 4 |
| To what value do nonglobal variables default?
1) auto
2) register
3) static
| | 4 |
| An interactive c program to read basic salary of 15
persons. each person gets 25% of basic as HRA, 15%of basic
as conveyance allowances, 10%of basic as entertainment
allowances.The total salary is calculated by adding
basic+HRA+CA+EA.Calculate how many out of 15 get salary
above 10,000.Rs also print the salary of each employee | | 2 |
| wap in c to accept a number display the total count of digit | | 4 |
| main()
{
clrscr();
}
clrscr();
| ME | 3 |
| write a fuction for accepting and replacing lowercase
letter to'Z' with out using inline function. | Temenos | 4 |
| Find Index of least significant bit set in an Integer. ex.
int value is say 10001000 results should be 4. | | 1 |
| Main must be written as
a.the first function in the program
b.Second function in the program
c.Last function in the program
d.any where in the program
| TCS | 12 |
| 2. What is the function of ceil(X) defined in math.h do?
A)It returns the value rounded down to the next lower
integer
B)it returns the value rounded up to the next higher integer
C)the Next Higher Value
D)the next lower value
| Accenture | 2 |
| 1.write a program to merge the arrays
2.write efficient code for extracting unique elements from a
sorted list of array? | Qualcomm | 2 |
| What's the difference between struct x1 { ... }; and
typedef struct { ... } x2; ?
| | 3 |
| |
| For more C Interview Questions Click Here |