Q. What will be the output of the following C++ function?

Code:
        int main()
        {
            register int i = 1;
            int *ptr = &i;
            cout << *ptr;
    	return 0;
        }
  • (A) 1
  • (B) 0
  • (C) Compiler error may be possible
  • (D) Runtime error may be possible
πŸ’¬ Discuss
βœ… Correct Answer: (C) Compiler error may be possible

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
219
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Babita
Publisher
πŸ“ˆ
90%
Success Rate