We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ceb25a commit 0c4c94dCopy full SHA for 0c4c94d
School/C++ Pointers ( Incrementing a variable) | Set 1/c-pointers-incrementing-a-variable-set-1.cpp
@@ -0,0 +1,31 @@
1
+//{ Driver Code Starts
2
+#include<iostream>
3
+using namespace std;
4
+void updateVar(int *a);
5
+
6
+int main()
7
+{
8
+ int t;
9
+ cin>>t;
10
+ while(t--)
11
+ { int a;
12
+ cin>>a;
13
+ updateVar(&a);
14
+ cout<<a<<"\n";
15
+ }
16
+ return 0;
17
+}
18
+// } Driver Code Ends
19
20
21
+/* This function is invoked by passing the address of the variable.
22
+ You need to increment the value stored in the variable by 10 */
23
24
+/* complete the function below */
25
26
+void updateVar(int *a)
27
28
+ // write your code here
29
+ *a+=10;
30
+ return;
31
0 commit comments