Pointers Pseudocodes - 1
Pointers Pseudocodes - 1
#include <stdio.h>
int main() {
int a = 4;
p = &a;
while (*p > 0)
{
printf("%d", *p);
(*p)--;
}
return 0;
}
Options:
a) 01234
b) 1234
c) 4321
d) 0
Explanation
1. Initialization: The integer variable a is initialized to 4, and a pointer p is created
to point to a.
2. While Loop: The loop continues as long as the value pointed to by p (which is
the value of a) is greater than 0. Inside the loop:
● The current value of *p (the value of a) is printed.
● The value of *p is decremented by 1.
3.
4. Execution Flow:
● The loop will print the values of a from 4 down to 1, resulting in the
output being printed in reverse order.
5.