C Languages Interview Questions

45. How do you determine the length of a string value that was stored in a variable?
 
  • To get the length of a string value, use the function strlen().
  • For example, if you have a variable named FullName, you can get the length of the stored string value by using this statement: I = strlen(FullName); the variable I will now have the character length of the string value.
 
Your Name Your Email-ID
Your Answer
46. Can variable name start with numbers?
  No. variable names can't start with numbers as per the variable naming rule.
 
Your Name Your Email-ID
Your Answer
47. What is the difference between functions getch() and getche()?
 
  • Both functions will accept a character input values from the user.
  • When using getch(), the key that was pressed will not appear on the screen, and is automatically captured and assigned to a variable.
  • When using getche(), the key that was pressed by the user will appear on the screen, while at the same time being assigned to a variable.
 
Your Name Your Email-ID
Your Answer
48. Can we make our own library of functions?
 
  • Yes. Different compilers provide different utilities to add/delete/modify functions in the standard library.
  • For example Turbo C/C++ compilers provide a utility called TLIB.EXE. Using this utility we can also develop a completely new library.
 
Your Name Your Email-ID
Your Answer
123456789101112


131415 Page 12 of 15