What is C Programming Language?

C is a programming language developed at AT & T’s Bell Laboratories of USA in 1972. It was designed and written by a man named Dennis Ritchie. In the late seventies C began to replace the more familiar languages of that time like PL/I, ALGOL, etc. No one pushed C. It wasn’t made the ‘official’ Bell Labs language. Thus, without any advertisement C’s reputation spread and its pool of users grew. Ritchie seems to have been rather surprised that so many programmers preferred C to older languages like FORTRAN or PL/I, or the newer ones like Pascal and APL. But, … Click here to continue…..

C Programming Interview Questions and Answers-7

Q: – Write a program to reverse a string with out using any array?

Q: – How do you find IP adress of ur system? ipconfig – in windows cmd mode. ifconfig -a in linux and hostname|nslookup in linux. Q: – What is the output of this program?

Answer:Run time error(segmentation fault). Reason: in function Allocate, we have allocated memory by using malloc function and assigned adress of that block to local pointer str. when control returns from that function the pointer (str) dies.so it will not affect in the main function. in main function,we are trying to … Click here to continue…..

C Programming Interview Questions and Answers-6

Q: – Explain “method”? A Method is a programmed procedure. It is defined as part of a class also included in any object of that class. Class can have more than one methods. It can be re-used in multiple objects. Q: – What is the output of the bellow program? segmentation fault.because we are trying to read/assign character into const string.

Q: – Write a program to display number from the bellow string? char *ptr=”HELLO57hai”

Q: – what are compilation process or steps? prepocessor -> compiler -> assembler -> linkEditor == Executable code Q: – There are numbers … Click here to continue…..

C Programming Interview Questions and Answers-5

Q: – How do you remove a macro name? By using the #undef directive with a macro name, that macro name can be removed, or “undefined.” Q: – Why do you need the #endif directive? The #endif directive is used with an #if, #ifdef, or #ifndef directives because statements under the control of a conditional preprocessor directive are not enclosed in braces ({ and }). Therefore, #endif must be used to mark the end of the block of statements. Q: – Can the conditional expression following the #if directive be an arithmetic expression? Yes Q: – What is the difference … Click here to continue…..

C Programming Interview Questions and Answers-4

Q: – Why do we need function prototypes? With the help of a function prototype, the compiler can automatically perform type checking on the definition of the function, which saves you time in debugging the program. Q: – Can a function return a pointer? Yes Q: – Why do you need to use arrays of pointers? It is convenient to use an array of pointers to point to a set of character strings so that you can access any one of the strings referenced by a corresponding pointer in the array. Q: – What does it mean if the malloc() … Click here to continue…..