C++ Interview Question and Answers

41. What are the rules for framing variable name?
 
  • Variable names may contain letters, numbers and underscore character(_).
 
Your Name Your Email-ID
Your Answer
`
42. Write a short note on enumerated data type?
 
  • Enumerated data type helps users in creating a list of identifiers, also called as symbolic numeric constants of the type int.
  • Syntax : enum data type identifier ( value 1, value 2,….value n).
 
Your Name Your Email-ID
Your Answer
43. How can the special character be represented?
 
  • Special characters are represented using escape sequences.
  • Escape sequences are represented using characters prefixed with a backslash.
 
Your Name Your Email-ID
Your Answer
44. What are the divisions in integral type?
 
  • The divisions in Integral type are int and char. Integral is the integer data type.
  • It cannot hold fractional values. Char is character data type that can hold both the character data and the integer data.
 
Your Name Your Email-ID
Your Answer
45. What effect does the visibility label public, has on the members of a class?
  The members that have been declared as public can be accessed from outside the class also.
 
Your Name Your Email-ID
Your Answer
12345678910 Page 9 of 10