some tricky c interview questions to practice. Learn c and c++ programming interview skill. predicting output of sample program is way of refreshing your basic concepts.

1.what could be output of below c code?

output:
fffffff0

2. write c code for the below problem.

Given a number n, give me the numbers (among 3..5 and an even number of numbers) whose adding would return the original number.
The resulting numbers should be as balanced as possible, meaning that instead of returning 3 and 5, for instance, return 4 and 4. Ex:

7 = 3 + 4
16 = 4 + 4 + 4 + 4 rather than 3 + 5 + 4 + 4
24 = 12 + 12 or 6 + 6 + 6 + 6

3. will the below code compile??

4. What’s the output of the following program?

5. Write a c program to find size of structure without using sizeof operator?

6. How can you find if a variable is allocated in stack or heap?

7. What could be the output of below program?

8. Add two numbers without using + or – operator in c.

 

Ref:

https://www.quora.com/How-do-I-add-two-numbers-without-using-any-operator-C-C++




Related Contents to follow