From 34f042e57d05f1f3e648524dc30c9feb33a238d4 Mon Sep 17 00:00:00 2001 From: "Hazal2.Veziroglu@live.uwe.ac.uk" <hazal2.veziroglu@live.uwe.ac.uk> Date: Mon, 25 Nov 2024 16:20:16 +0000 Subject: [PATCH] Upload New File --- worksheet0/task1_pointer.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 worksheet0/task1_pointer.c diff --git a/worksheet0/task1_pointer.c b/worksheet0/task1_pointer.c new file mode 100644 index 0000000..103b7d7 --- /dev/null +++ b/worksheet0/task1_pointer.c @@ -0,0 +1,12 @@ +#include <stdio.h> + +int main() { + int n = 10; + int *ptr_to_n = &n; + + // Increment the value of n using the pointer + (*ptr_to_n)++; + printf("Value of n after increment: %d\n", n); + + return 0; +} -- GitLab