we creating an pointer variable then used it.
#include <stdio.h>
int main() {
int myAge = 43; // An int variable
int* ptr = &myAge; // A pointer variable, with the name ptr, that stores the address of myAge
// Output the value of myAge (43)
printf("%d\n", myAge);
// Output the memory address of myAge (0x7ffe5367e044)
printf("%p\n", &myAge);
// Output the memory address of myAge with the pointer (0x7ffe5367e044)
printf("%p\n", ptr);
return 0;
}
we doing call a function multiple times.
#include <stdio.h>
// Create a function
void myFunction() {
printf("I just got executed!\n");
}
int main() {
myFunction(); // call the function
myFunction(); // call the function
myFunction(); // call the function
return 0;
}
about c program
#include <stdio.h>
int main() {
printf("Hello World!");
return 0;
}
we are doing print sum of two numbers with the help of addition operator.
#include <stdio.h>
int main() {
int myNum = 100 + 50;
printf("%d", myNum);
return 0;
}
we are doing print Sum of variable and Numbers with the help of Addition Operator
#include <stdio.h>
int main() {
int sum1 = 100 + 50; // 150 (100 + 50)
int sum2 = sum1 + 250; // 400 (150 + 250)
int sum3 = sum2 + sum2; // 800 (400 + 400)
printf("%d\n", sum1);
printf("%d\n", sum2);
printf("%d\n", sum3);
return 0;
}