Common Interview Questions from HR

Question: Tell me about yourself. Answer: The most often asked question in interviews. You need to have a short statement prepared in your mind. Be careful that it does not sound rehearsed. Limit it to work-related items unless instructed otherwise. Talk about things you have done and jobs you have… Continue reading

What is the difference between declaration and definition?

The declaration tells the compiler that at some later point we plan to present the definition of this declaration. E.g.: void stars () //function declaration The definition contains the actual implementation. E.g.: void stars () // declarator { for(int j=10; j > =0; j–) //function body cout << *; cout… Continue reading

C Programming Interview Questions and Answers-7

Q: – Write a program to reverse a string with out using any array? #include<stdio.h> int main() { char *str=”Mahesh”; char *ptr=str+strlen(str); while(ptr>=str) { printf(“%c”,*ptr); ptr–; } } Q: – How do you find IP adress of ur system? ipconfig – in windows cmd mode. ifconfig -a in linux and… Continue reading

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?… Continue reading

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… Continue reading

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… Continue reading

C Programming Interview Questions and Answers-3

Q: – What are stdin, stdout, and stderr? In C, a file is treated as a series of bytes that is called file stream. stdin, stdout, and stderr are all pre-opened file streams. stdin is the standard input for reading; stdout is the standard output for writing; stderr is the… Continue reading

C Programming Interview Questions and Answers-2

Q: – Why is the main() function needed in a program? The execution of a C program starts and ends with the main() function. Without the main() function, the computer does not know where to start to run a program. Q: – What does the #include directive do? The #include… Continue reading