Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Function Argument Variables In C Programming Job Interview Question and Answers

1. What is the purpose of main() function?
Answer:-main() is the user-defined function. main() is the first function in the program, which gets called when the program executes. The startup code contains runmain() function, which calls main() function, we can't change the name of the main() function.

Function Programming In C
Programming Twenty Interview Questions
C Viva Questions for Engineering Freshers
Function And Pointers

2. What is an argument? Differentiate between Formal Arguments and actual arguments?
Answer:-The actual arguments are the arguments with which the function can be called. The formal arguments are the arguments with which the function can be defined. In simple words, function call contains actual arguments and function definition contains formal arguments.



3. What is the difference between character array and string in C?
Answer:-The major difference between the char array and the string is that the array will not end with the null, whereas string ends with the null.

4. Is it possible to print colors with printf statements?
Answer:-Yes, there are already ready made functions in header file conio.h
textcolor(5) will change the color to the pink. Similarly by changing the value we get different colors.

5. What is the type of the variable b in the following declaration?
#define FLOATPTR float*
FLOATPTR a, b;

a) float
b) float pointer
c) int
d) int pointer
Answer:-float-The statement FLOATPTR a,b; becomes float* a,b; Here "a" is a float pointer, but "b" is just an float variable, so the correct type for "b" is "float", and not "float-pointer". The above problem demonstrate the drawback of using #define constant. To avoid this situation use typedef's in place of #define.
CONTINUE READING »


This post first appeared on IngenuityDias, please read the originial post: here

Share the post

Function Argument Variables In C Programming Job Interview Question and Answers

×

Subscribe to Ingenuitydias

Get updates delivered right to your inbox!

Thank you for your subscription

×