☰
×
Home
◈ Introduction
C - Data Types IQ
◈ C Data Type Tricky - I
◈ C Data Type Tricky - II
◈ C Data Type Tricky - III
◈ C Data Type Tricky - IV
◈ C Data Type Tricky - V
C - Operators IQ
◈ C Operators Tricky - I
◈ C Operators Tricky - II
◈ C Operators Tricky - III
Choose the Correct
◈ Choose the Correct Ans - I
◈ Choose the Correct Ans- II
◈ Choose the Correct Ans - III
◈ Choose the Correct Ans - IV
◈ Choose the Correct Ans - V
◈ Choose the Correct Ans - VI
Find Output - Tricky
◈ C Pgm Tricky Questions I
◈ C Pgm Tricky Questions II
◈ C Pgm Tricky Questions III
◈ C Pgm Tricky Questions IV
◈ C Pgm Tricky Questions V
◈ C Pgm Tricky Questions VI
◈ C Pgm Tricky Questions VII
◈ C Pgm Tricky Questions VIII
◈ C Pgm Tricky Questions IX
C - General IQ
◈ General C Questions I
◈ General C Questions II
◈ General C Questions III
◈ General C Questions IV
◈ General C Questions V
◈ General C Questions VI
◈ General C Questions VII
Home
About
Consulting
Training
Tutorial
Interview Questions
Contact
Interview Questions
C Pgm - General Questions
Home
C Interview Questions
◈ Introduction
C Data Types Tricky Questions
◈ C Data Type Tricky Questions I
◈ C Data Type Tricky Questions II
◈ C Data Type Tricky Questions III
◈ C Data Type Tricky Questions IV
◈ C Data Type Tricky Questions V
C Operators Interview Questions
◈ C Operators Tricky Questions I
◈ C Operators Tricky Questions II
◈ C Operators Tricky Questions III
Choose the Correct Answer
◈ Choose the Correct Answer I
◈ Choose the Correct Answer II
◈ Choose the Correct Answer III
◈ Choose the Correct Answer IV
◈ Choose the Correct Answer V
◈ Choose the Correct Answer VI
Find Output - Tricky C Program
◈ C Programs Tricky Questions I
◈ C Programs Tricky Questions II
◈ C Programs Tricky Questions III
◈ C Programs Tricky Questions IV
◈ C Programs Tricky Questions V
◈ C Programs Tricky Questions VI
◈ C Programs Tricky Questions VII
◈ C Programs Tricky Questions VIII
◈ C Programs Tricky Questions IX
General C Interview Questions
◈ General C Questions I
◈ General C Questions II
◈ General C Questions III
◈ General C Questions IV
◈ General C Questions V
◈ General C Questions VI
◈ General C Questions VII
C Programming Interview Questions
General Questions VII
« Prev
C Program - General Questions
1. Define unaligned access and give an example. What would happen if unaligned read/write operation is performed? a) Write a macro to check if a given address is aligned or un-aligned. b) Write a function in c that reads unsigned integer from an un-aligned address. 2. What is the use of double pointer? Write an example C program describing its use? 3. Write a macro that converts a given integer value to Boolean? 4. Write a c program to get the offset in bytes of member “x” from the below structure. struct abc { char a; short b; unsigned c; char x; long y; double z; }; 5. Write a function to get the value b/w two given bit positions from an integer. 6. In the below program, in the while loop, how many iterations will it take for while loop to exist? Unsigned char i; while(i<512) i++; printf(“no of iterations : %d\n”,i); 7. Imagine there is no definition of NULL in the standard C library. How do you define your own NULL macro? 8. Write a program to find if a machine is big endian or little endian. 9. Wap to find how many 1's having 0 on its right side and 1 on left side (i.e. 110) in given hexadecimal number. 10. Write two function in C( say alloc_no()) should return unique number for every time we call it . Another function (free_no()) should take number as argument and free the allocated number . Example : alloc_no() => 1 // return 1, mark number 1 is allocated alloc_no() => 2 // return 2, mark number 2 is allocated alloc_no() => 3 // return 3, mark number 3 is allocated FREE_NO(2) // MARK NUMBER 2 IS FREE alloc_no() => 2 // return 2, mark number 2 is allocated alloc_no() => 4 // return 2, mark number 4 is allocated 11. Write a simple c program to demonstrate array of function pointer and calling function in that array dynamically. 12. Write a c program to show compilation error when changing address and value of a pointer variable which declared as read only address and read only value. 13. Explain what is SIGSEGV and SIGBUS in Linux and their differences? Write two separate c programs for Linux platform which would throw these signals. 14. You are given set of numbers from 1 to n (except which is a duplicate) in a SLL in scattered order (not in sequence). How do you write a program to find the duplicate number? Explain what the other methods Are to solve and its pros/cons. 15. Why a Microsoft window is not RTOS? What functionality would you add to MICROSOFT OS to make it a RTOS? 16. What is the difference between the static global variable and global variable? 17. Write a program menu based program to set a bit and clear a bit? 18. Write a program to arrange given array so that all ones will come after all zeros. int a[]={1,0,0,1,0,1,0,0,1,1} PROGRAMS -------------- 1. Write a c program for simple browser that does the following operations? a) Open a web page. b) Open a link from the page c) Implement the forward, backward and refresh operation 2. Write a c program to simulate the functions of a vending machine : a) Get the choice of the product. b) Get the money. c) From pre-defined mapping make sure sufficient money is deposited by the customer and dispatch the product or return and throw error if in-sufficient. d) If the product is empty , display it appropriately 3. Write a c program to handle the traffic signal in a 4-way junction: a) Assume 30 second interval for each direction. b) Assume 5 seconds buffer for yellow signal, and display it before going to step. c) Handle pedestrian crossing situations as well – assume 10 seconds in each direction. ? 4. Wap to "odd string" in a file. 5. Reverse string w/o using any temporary buffer. 6. Wap to sum of four, 100 digits decimal numbers 7. Write a C Program Input= 0x12345678 Output= 0x21436587 8. mirror image 1 2 3 4 5 6 7 8 9 Output 3 2 1 6 5 4 9 8 7 9. Wap to toggle Nth Bit assuming at least 3 bits. Suppose if num is 0x00001234 then N is 4 10. Assume you have a method is Substring which checks if one word is a substring of another Given two strings, s1 and s2, write code to check if s2 is a rotation of s1 using only one call to is Substring (i.e. “waterbottle” is a rotation of “erbottlewat”
« Prev
Helpful Links
Sateeshkg Home
Interview Questions
Corporate Training
Recommended Books
Linux Consulting
Apply for Job Assistance
If you have any queries please email us at
info@motionzen.com