Introduction to Programming in C
Sep 8, 2024
C Programming Tutorial 3 - Writing Our First Program - H…
H…
Teilen
Ansehen auf
Lecture Notes: Writing Your First Computer Program
Introduction to the Video
Host: Caleb from Caleb the Video Maker 2
Objective: Write the first computer program
Clearing the Shell
Command: `clear`
Used to clear the terminal screen
Creating a New File
File Name: `hello.c`
`.c` denotes a C programming language file
Using Vim Text Editor
Insert Mode
Enter: Press `i`
Exit: Press `Esc`
Navigating in Vim
Use arrow keys in insert mode
More navigation tricks will be covered in future videos
Writing the First Program
Code Structure
Include Standard IO Library:
#include <stdio.h>
Main Function:
int main() {
// Code goes here
}
Print Statement:
printf("Hello world!\n");
`\n` is a newline character
Return Statement: