1 Hello, C
Execution starts at main(). printf writes formatted output; \n is a newline; statements end with ;.
#include <stdio.h>
int main() {
printf("Hello, C!\n");
printf("Numbers: %d and %d\n", 10, 20);
return 0;
}
printf, variables, arithmetic and your first loops.
Execution starts at main(). printf writes formatted output; \n is a newline; statements end with ;.
#include <stdio.h>
int main() {
printf("Hello, C!\n");
printf("Numbers: %d and %d\n", 10, 20);
return 0;
}
C is statically typed: declare int, float or char before use. Format specifiers match types (%d, %f).
#include <stdio.h>
int main() {
int a = 12, b = 5;
printf("Sum = %d\n", a + b);
printf("Div = %d\n", a / b);
printf("Mod = %d\n", a % b);
return 0;
}
The for loop repeats a block a fixed number of times.
#include <stdio.h>
int main() {
for (int i = 1; i <= 5; i++) {
printf("3 x %d = %d\n", i, 3 * i);
}
return 0;
}
Code runs on a learning-oriented simulated runtime that supports common constructs (output, variables, arithmetic, conditionals and loops).
7 tasks across 3 pages — multiple-choice and fill-in (type the answer). Score 70% or higher to earn your certificate.
🔒 Pass the quiz above (70%+) to unlock your downloadable certificate.
Congratulations! Enter your name to generate your certificate.