Wednesday 12 April 2017

Tips for C++ Revision Tour

1) Know keywords, identifiers, literals, punctuators, operators 

2) Know header files and associated functions

3) Identify the errors and rewrite corrected code

4) Predict the output:

   Be mindful of the following:
   i) function call - actual parameters and formal parameters
   ii) order of actual parameters
   iii) call by value and call by reference
   iv) If call by reference, be mindful of the changes in both actual and formal arguments
   v) Look out for endl or "\n" operators, if any, in output statements

5) Predict the output - character array

   Follow the code from main() function.
   Be mindful of the original string and the character, if any that is passed as actual parameters.
   In the function, manually dry run the changes that are taking place in the original string based on the if condition.
   These changes will be reflected in the original string.
   Display the updated string
   string[i-1] signifies prev character, string[i]-1 signifies decrementing the character by 1

Predict the output - numeric array
Read code in main()
Be mindful of the actual parameters and formal parameters
Reflect the changes in array as required
Write the contents of the updated array as specfied in cout statement.

6) Random question
Identify the minimum and maximum values variable can take while storing random numbers.
Start from option 1 onwards, and do the elimination process
Finally arrive at the ones which cannot be eliminated


      

No comments:

Post a Comment