Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
28 views
in Computer by (25 points)
Void main ()

{

Int a=67;

int *b=&a;

cout <<a<<""<<*b<<end1;

a++;

cout<<a<<""<<*b<<end1;

}

Please log in or register to answer this question.

1 Answer

0 votes
by (13.8k points)
#include <iostream>
using namespace std;

int main() {
    int a = 67;
    int *b = &a;
    cout << a << "" << *b << endl; // Output: 67 67
    a++;
    cout << a << "" << *b << endl; // Output: 68 68

    return 0;
}

  1. a is initialized to 67.
  2. b is assigned the address of a.
  3. cout << a << "" << *b << endl; prints the value of a (67) and the value pointed to by b (also 67).
  4. a is incremented (a++).
  5. cout << a << "" << *b << endl; prints the updated value of a (68) and the updated value pointed to by b (now also 68, because b points to a, which has been incremented).

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...