Print a line
Send text to the output with printf. An easy embedded C problem (First steps in C), run and graded in the browser.
easy · First steps in C · printf
printf writes text to the output. On a real board that output usually goes to a serial port, and it is the first debugging tool everyone reaches for.
Make greet print exactly Hello, board! followed by a newline. A newline is written \n inside the quotes.
Starter code
void greet(void) {
// void means this function returns nothing. It only prints.
}Example tests
Prints the greeting
greet();Expected output:
Hello, board!Learn it first
- Microcontrollers and your first program · What a microcontroller is, how code gets onto it, and the parts of a C program.
More First steps in C problems
- Return a value · Make a function hand back a number.
- Add two numbers · Use the inputs a function receives.
- Fix a compiler error · Read an error message and repair the code.
- Minutes to seconds · Convert a duration with one multiplication.
- Area of a rectangle · Combine two parameters into one result.
- Print a number · Put a value into printed text with a placeholder.