C Tutorial menu

C Tutorial

C is one of the oldest and most important programming languages. It was created in the early 1970s and is still used today to write operating systems, device drivers, embedded systems and fast software.

Linux, parts of Windows, and the software inside washing machines, cars and routers are written in C.

Why Learn C?

  • It shows you how a computer really works: memory, addresses and bytes
  • It is very fast and runs on almost every device
  • Many languages, such as C++, C#, Java and JavaScript, borrow its syntax
  • It is taught in most university computer science courses in Pakistan

What You Will Learn

  • How to compile and run a C program
  • Output with printf, comments, variables, data types and input with scanf
  • Operators, if...else, switch and loops
  • Arrays and strings
  • Functions and pointers

A First Example

Example

c
#include <stdio.h>

int main(void) {
  printf("Hello from C!\n");
  return 0;
}
Output
Hello from C!

Every C program starts running from the main function. The first chapters explain each line.

Check Yourself

Exercise

Which function does every C program start from?

What to Learn After C

After C, the natural next step is C++, which adds classes and objects to C. You can also try Java or C# for building larger applications.

Want to learn programming with a teacher? The Workownix programming course starts with Python, and the core ideas (variables, conditions, loops and functions) carry over directly to C. Join online or at our institute in Orangi Town, Karachi.

Learn C with a teacher

Join the Python Programming course at Workownix, online or in Orangi Town, Karachi, and get a certificate.

See the course Ask on WhatsApp