You are not logged in.

#1 2012-03-27 05:19:45

User RankUser RankUser RankUser RankUser RankUser Rank
Agent Vinod
From: India
Registered: 2012-03-23
Posts: 1,149

C Programming Interview Questions And Answers

Basic Programming :: Basic and Advance C Job Interview Questions and Answers

C Programming Interview Questions and Answers will guide you that C is a general-purpose computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories and C language is for use with the Unix operating system.
If you are developer and need to update your software development knowledge regarding basic and advance C programming or need to prepare for a job interview? Check out this collection of basic and advance C programing Interview Questions and Answers.

1 What is C language?
2 What is Duffs Device?
3 Here is a good puzzle: how do you write a program which produces its own source code as output?
4 Suggesting that there can be 62 seconds in a minute?
5 Was 2000 a leap year?
6 How can I find the day of the week given the date?
7 What is hashing in C?
8 I need a sort of an approximate strcmp routine ...
9 What is C Programing language?
10 How can I call FORTRAN?
11 What is assert and when would I use it?
12 Why doesnt C have nested functions?
13 Does C have an equivalent to Pascals with statement?
14 If the assignment operator were ...
15 Is C a great language, or what?
16 Does C have circular shift operators?
17 There seem to be a few missing operators ...
18 Why isnt there a numbered, multi-level break statement to break out
19 Why dont C comments nest?
20 Are the outer parentheses in return statements really optional?
21 Is there a way to have non-constant case labels (i.e. ranges or arbitrary expressions)?
22 Is there a way to switch on strings?
23 Which is more efficient, a switch statement or an if else chain?
24 How can I swap two values without using a temporary?
25 People claim that optimizing compilers are good and that we no longer have to write things in assembler for speed
26 I have been replacing multiplications and divisions with shift operators, because shifting is more efficient.
27 Are pointers really faster than arrays?
28 What is the best way of making my program efficient?
29 What is the most efficient way to count the number of bits which are set in an integer?
30 Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
31 How can I convert integers to binary or hexadecimal?
32 How do I swap bytes?
33 How can I determine whether a machines byte order is big-endian or little-endian?
34 How can I implement sets or arrays of bits?
35 How can I manipulate individual bits?
36 If I have a char * variable pointing to the name of a function ...
37 How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
38 What is the right way to use errno?
39 What is a good data structure to use for storing lines of text?
40 How can I return multiple values from a function?
41 Why isnt any of this standardized in C? Any real program has to do some of these things.
42 But I cant use all these nonstandard, system-dependent functions, because my program has to be ANSI compatible!
43 What are near and far pointers?
44 I am trying to compile this program
45 How can I ensure that integer arithmetic doesnt overflow?
46 How can I handle floating-point exceptions gracefully?
47 How can I trap or ignore keyboard interrupts like control-C?
48 How can I implement a delay, or time a users response, with sub-second resolution?
49 How can I read in an object file and jump to locations in it?
50 Is exit(status) truly equivalent to returning the same status from main?
51 How can I open files mentioned on the command line, and parse option flags?
52 How can a process change an environment variable in its caller?
53 How can I automatically locate a programs configuration files in the same directory as the executable?
54 How can my program discover the complete pathname to the executable from which it was invoked?
55 How can I invoke another program or command and trap its output?
56 How do I get an accurate error status return from system on MS-DOS?
57 How can I call system when parameters (filenames, etc.) of the executed command arent known until run time?
58 How can I invoke another program (a standalone executable, or an operating system command) from within a C program?
59 How can I do PEEK and POKE in C?
60 I thought that using large model meant that I could use more than 64K of data!
61 How can I allocate arrays or structures bigger than 64K?
62 How can I find out how much memory is available?
63 How do I create a directory? How do I remove a directory (and its contents)?
64 How can I read a directory in a C program?
65 How can I find out how much free space is available on disk?
66 How can I increase the allowable number of simultaneously open files?
67 fopen isnt letting me open files like "$HOME/.profile" and "~/.myrcfile".
68 Why cant I open a file by its explicit path?
69 How do I copy files?
70 How can I delete a file?
71 How can I recover the file name given an open stream or file descriptor?
72 ow can I insert or delete a line (or record) in the middle of a file?
73 How can I find the modification date and time of a file?
74 How can I find out the size of a file, prior to reading it in?
75 How can I check whether a file exists? I want to warn the user if a requested input file is missing.
76 How can I send mail from within a C program?
77 How can I do graphics in C?
78 How can I access an I O board directly?
79 How do I send escape sequences to control a terminal or other device?
80 How can I direct output to the printer?
81 How can I do serial comm port I O?
82 How do I read the arrow keys? What about function keys?
83 How can I make it pause before closing the program output window?
84 How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
85 How can I find out if there are characters available for reading?
86 I need code to parse and evaluate expressions.
87 Dont ANSI function prototypes render lint obsolete?
88 Where can I get an ANSI-compatible lint?
89 How can I shut off the warning ...
90 I just typed in this program, and it is acting strangely. Can you see anything wrong with it?
91 People always say that good style is important
92 What is Hungarian Notation? Is it worthwhile?
93 Should I use symbolic names like TRUE and FALSE for Boolean constants, or plain 1 and 0?
94 If NULL and 0 are equivalent as null pointer constants, which should I use?
95 I came across some code that puts a (void) cast before each call to printf. Why?
96 I have seen function declarations that look like this
97 Why do some people write if(0 == x) instead of if(x == 0)?
98 Here is a neat trick for checking whether two strings are equal
99 How should functions be apportioned among source files?
100 What is the best style for code layout in C?
101 Why does this code crash?
102 This program runs perfectly on one machine ...
103 I have a program that seems to run correctly
104 This program crashes before it even runs!
105 Why isnt my procedure call working? The compiler seems to skip right over it
106 I am getting baffling syntax errors which make no sense at all
107 Why is this loop always executing once?
108 How can I call a function with an argument list built up at run time?
109 I cant get va_arg to pull in an argument of type pointer-to-function.
110 I have a varargs function which accepts a float parameter
111 My compiler isnt letting me declare a function
112 How can I discover how many arguments a function was actually called with?
113 How can I write a function analogous to scanf
114 How can I write a function that takes a format string and a variable number of arguments
115 I had a frustrating problem which turned out to be caused by the line
116 How can f be used for both float and double arguments in printf? Are not they different types?
117 I heard that you have to include stdio.h before calling printf. Why?
118 I am having trouble with a Turbo C program which crashes
119 What is a good way to implement complex numbers in C?
120 The predefined constant M_PI seems to be missing from my machines copy of math.h.
121 Why does not C have an exponentiation operator?
122 How do I round numbers?
123 I am sure I have got the trig functions declared correctly, but they are still giving me wrong answers.
124 My floating-point calculations are acting strangely and giving me different answers on different machines.
125 I am trying to do some simple trig, and I am #including <math.h>, but the linker keeps complaining that functions like sin and cos are undefined
126 When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
127 What does it mean when the linker says that _end is undefined?
128 What is the difference between memcpy and memmove?
129 How can I generate floating-point random numbers?
130 How can I retHow can I return a sequence of random numbers which dont repeat at all?
131 How can I get random integers in a certain range?
132 Did C have any Year 2000 problems?
133 How can I sort more data than will fit in memory?
134 How can I sort a linked list?
135 How can I get the current date or time of day in a C program?
136 How can I split up a string into whitespace-separated fields?
137 Why do some versions of toupper act strangely if given an upper-case letter?
138 How do I convert a string to all upper or lower case?
139 why isnt it being handled properly?
140 How can I read/write structures from/to data files?
141 How can I change their mode to binary?
142 What is the difference between text and binary I/O?
143 How can I read a binary data file properly?
144 How can I get back to the interactive keyboard if stdin is redirected?
145 Once I have used freopen, how can I get the original stdout (or stdin) back?
146 How can I recover the file name given an open stream?
147 How can I insert or delete a line (or record) in the middle of a file?
148 If fflush wont work, what can I use to flush input?
149 Why does everyone say not to use gets?
150 What is the deal on sprintfs return value?
151 Why does everyone say not to use scanf? What should I use instead?
152 How can I read data from data files with particular formats?
153 Why doesnt that code work?
154 Why doesnt this code work?
155 Why does the call char scanf work?
156 Why doesnt the call scanf work?
157 Why doesnt long int work?
158 What is wrong with this code?
159 What does the message "Automatic aggregate intialization is an ANSI feature" mean?
160 What was noalias and what ever happened to it?
161 What should malloc0 do? Return a null pointer or a pointer to 0 bytes?
162 What are pragmas and what are they good for?
163 What is the correct declaration of main?
164 Can you mix old-style and new-style function syntax?
165 What is the ANSI C Standard?
166 How can I list all of the predefined identifiers?
167 How can I use a preprocessorif expression to ?
168 Is there anything like an ifdef for typedefs?
169 What is the difference between #include <> and #include?
170 What are the complete rules for header file searching?
171 What is the right type to use for Boolean values in C? Is there a standard type? Should I use #defines or enums for the true and false values?
172 Why does notstrcat(string, "!");work?
173 Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
174 What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
175 How can I dynamically allocate arrays?
176 What is wrong with this initialization?
177 How can this be legal C?
178 Is a pointer a kind of array?
179 Why ca not I do something like this?
180 Is NULL valid for pointers to functions?
181 How do I get a null pointer in my programs?
182 What is this infamous null pointer, anyway?
183 What is the total generic pointer type?
184 Can I initialize unions?
185 What are pointers really good for, anyway?
186 Are enumerations really portable?
187 C is not C++. Typedef names are not automatically generated
188 What is the auto keyword good for?
189 What is wrong with this declaration?
190 Linked Lists -- Can you tell me how to check whether a linked list is circular?
191 What does static variable mean in c?
192 What are the different storage classes in C?
193 What is hashing in C language?
194 What is page thrashing?
195 What is the benefit of using #define to declare a constant?
196 How can I search for data in a linked list?
197 When should a type cast be used?
198 What is a null pointer in C?
199 What is the stack in C?
200 What is Preprocessor in C?
201 What is the heap in C?
202 What is the purpose of realloc( )?
203 What is the purpose of main( ) function?
204 What is the benefit of using const for declaring constants?
205 What is the easiest sorting method to use?
206 What is a const pointer in C?
207 What is a pragma in C?
208 What is #line used for?
209 What is the difference between far and near in C?
210 What is a method in C?
211 Are pointers integers in C?
212 How do you redirect a standard stream?
213 What is indirection in C?
214 What is an lvalue in C?
215 Array is an lvalue or not?
216 What is a void pointer in C?
217 What is a pointer variable in C language?
218 What is a static function in C?
219 What is a pointer value and address in C?
220 How do we print only part of a string in C?

2012-03-27 05:19:45

Ads By Google

Re: C Programming Interview Questions And Answers

The following user say "Thank You" for this post:Guest

Board footer