logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • How variable declaration in c++ differs that in c?


  • Correct Answer
  • C requires all the variables to be declared at the beginning of a scope but in c++ we can declare variables anywhere in the scope This makes the programmer easier to understand because the variables are declared in the context of their use 


  • Technology problems


    Search Results


    • 1. Where is the reference stored?

    • Options
    • A. stack
    • B. heap
    • C. queue
    • D. None
    • Discuss
    • 2. Default constructor accepts how many arguments?

    • Options
    • A. one
    • B. two
    • C. three
    • D. None
    • Discuss
    • 3. What could be the bucket size if collision and overlapping occur at same time?

    • Options
    • A. 2
    • B. 0
    • C. 1
    • D. 4
    • Discuss
    • 4. What are the methods are available in storing sequential files?

    • Options
    • A. Natural merging
    • B. Polyphase sort
    • C. Distribution of Initial runs
    • D. All the above
    • Discuss
    • 5. A binary tree with 7 nodes will have how many null branches?

    • Options
    • A. 6
    • B. 7
    • C. 8
    • D. 5
    • Discuss
    • 6. What is friend function?
    • Discuss
    • 7. What is the output of this program? #include using namespace std; struct sec { int a; char b; }; int main() { struct sec s ={25,50}; struct sec *ps =(struct sec *)&s; cout << ps->a << ps->b; return 0; }

    • Options
    • A. 252
    • B. 253
    • C. 254
    • D. 262
    • Discuss
    • 8. What are the mandatory part to present in function pointers?

    • Options
    • A. &
    • B. retrun values
    • C. data types
    • D. none of these
    • Discuss
    • 9. What is the output of this program ? #include using namespace std; int n(char, int); int (*p) (char, int) = n; int main() { (*p)('d', 9); p(10, 9); return 0; } int n(char c, int i) { cout << c << i; return 0; }

    • Options
    • A. d99
    • B. d9d9
    • C. d9
    • D. compile time error
    • Discuss
    • 10. which keyword is used to define the macros in c++?

    • Options
    • A. macro
    • B. define
    • C. #define
    • D. none of these
    • Discuss


    Comments

    There are no comments.

Enter a new Comment