Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
#include <stdio.h> #include <stdlib.h> // Function declaration int add(int a, int b); void greet(const char* name); int main() { // Basic I/O printf("Hello, World! "); // Variables int x = 10, y = 20; float pi = 3.14159; char letter = 'A'; // Function calls printf("Sum: %d ", add(x, y)); greet("Alice"); // Pointer basics int value = 42; int *ptr = &value; printf("Value: %d, Address: %p ", *ptr, (void*)ptr); return 0; } int add(int a, int b) { return a + b; } void greet(const char* name) { printf("Hello, %s! ", name); }
Result
Open