In c void f (int *p, int * const q) { p=q *p=3; *p=4; }

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section: Chapter Questions
Problem 7PP
icon
Related questions
Question

In c 

void f (int *p, int * const q)

{

p=q

*p=3;

*p=4;

}

int i = 1, j =2;

int main(){

f(&i, &j);

printf("%d %d",i,j);

return 0;

}

a. The program prints 1 2 and terminates

b. the program prints 1 3 and 0

c. the program prints 1 4 and terminates

d. the program prints 3 4 and terminates

e. the program has compiler error

Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning