-
-
-
-
-
-
-
Fix Function
Write the implementation of Fix function? fix(2.5) = 2 and fix(-2.25) = -3, this is the expected result. Write the code to implement this behaviour?
-
-
-
-
How to call C++ code from C ?
How can I call my C++ code from C code can you point me to some examples that are explained in detail.ThanksAjit
-
C program to find 2 Digit Number
Write a program in C to find the 2 digit number which is 3 times its sum of its digits.
-
Array is an lvalue or not?
An lvalue was defined as an expression to which a value can be assigned. Is an array an expression to which we can assign a value? The answer to this question is no, because an array is composed of several separate array elements that cannot be treated as a whole for assignment purposes. The following statement is therefore illegal: int x[5], y[5]; x = y; Additionally, you might want to copy the whole...
-
What is the easiest searching method to use?
Just as qsort() was the easiest sorting method, because it is part of the standard library, bsearch() is the easiest searching method to use. If the given array is in the sorted order bsearch() is the best method. Following is the prototype for bsearch(): void *bsearch(const void *key, const void *buf, size_t num, size_t size, int (*comp)(const void *, const void*)); Another simple searching...
-
Is it better to use a macro or a function?
The answer depends on the situation you are writing code for. Macros have the distinct advantage of being more efficient (and faster) than functions, because their corresponding code is inserted directly into your source code at the point where the macro is called. There is no overhead involved in using a macro like there is in placing a call to a function. However, macros are generally small and...
-
Sequence of Function Execution
printf("%d%d",f1(),f2());What is the sequence of function execution of the above statement. 1. printf, f1(), f2()2. printf, f2(), f1()3. f1(), f2(), printf4. f2(), f1(), printf.
-
C Library Functions
Which function in C library helps to sort the elements in an array quickly?
-
Recursive Function
1. Find output for following recursive function :int main(){int i=32242,j=find(i);}int find(int j){if(j){j = j%10 + find(j/10);printf(" %d ",j);}return j;}
2. What is the problem with following code : char* AddnewlinetoString(char *s){char buffer[1024];strcpy(buffer,s);buffer[strlen(s)-1] = 'n';return buffer;} -
Source Code Output
Write a program which produces its own source code as its output?
-
C Interview Questions
Ans